>_ pa v0.1.0 · MIT
Open Source · MIT License · Linux x86-64

Python syntax.
Native C++ speed.

A statically compiled systems language built on LLVM. Zero type annotations in function bodies, contiguous RAII memory without a GC, and typed .paw bridges to the Python ecosystem.

$ pip install pa-lang
Provides pac CLI · LSP · doctor · bundle CPython 3.11–3.13
01import data_fetcher
02
03N = 64
04WINDOW = 4
05
06# sliding-window mean; parameter types inferred, RAII heap Vec returned
07def moving_average(xs) -> Vec[float]:
08    out = []
09    for i in range(N - WINDOW):
10        s = 0.0
11        for j in range(WINDOW):
12            s = s + xs[i + j]
13        out.append(s / WINDOW)
14    return out
15
16def main() -> int:
17    series = data_fetcher.fetch_series(N, 7)
18    smooth = moving_average(series)
19    p90 = data_fetcher.percentile(smooth, 90.0)
20    print(len(series), len(smooth), p90)
21    return 0
100% ast.parse compatible RAII free inserted at scope exit · 0 GC pauses

01 / Benchmarks

Compute speed-up over CPython 3.12

Differential-verified · Exact int/set · Float Δ < 1e-9

WORKLOAD (EXAMPLES/*)
Pa (LLVM -O2) CPython 3.12 (1.0×)
utm WGS84 Transverse Mercator, libm, special-zone branching · 100k points
~210×
165–250×
1.0×
benchmark 50M-iteration 64-bit LCG integer & Leibniz float loops
~110×
110×
1.0×
levenshtein UTF-8 byte spans, rolling arrays, flattened 2-D DP, String RAII · 50k pairs
~80×
65–95×
1.0×
kdtree Recursion, nested @struct AoS, manual-stack search, PIL render via .paw
~26×
22–29×
1.0×
delaunator Dynamic Vec growth, while loops, half-edge index jumps
~17×
17×
1.0×
Higher is faster. Measured on Linux x86-64 via examples/*/verify_*.py. Pure .pa binaries link zero libpython.

02 / Architecture & Tooling

Written by AI. Auditable by humans.

01 · SYNTAX & MEMORY ≤ 40 lines/fn · complexity ≤ 8

Python readability with flat C++ layout

Every .pa file parses with standard ast.parse. Function bodies stay free of type noise while bidirectional inference and escape analysis place lists on the stack ([N x T]) or RAII-managed heap ({T*, len, cap}).

pac lsp · inlayHints.detail = "detailed" 0 PyObject*
@struct
class UtmPoint:  # C layout, 26B natural alignment
    easting: float; northing: float; zone_letter: u8

buf = [0.0] * 16  : list[f64, 16] (128B stack)
out = []          : StackVec<f64, max=60> (Zero-Heap)
dyn = [0.0] * n   : Vec<f64> (RAII free @ return)
02 · COMPILER PIPELINE llvmlite · gcc

Native binaries & guarded .so

Direct AST lowering to LLVM IR with -O2. Ship standalone ELF executables or --shared libraries with setjmp fault guards for FastAPI shells.

*.pa source ast.parse *.paw headers In -> Out ABI validator + infer borrow · escape · RAII codegen · LLVM -O2 flat arrays · dev/prod checks runtime_*.c embedded .paw native ELF / lib.so gcc link · $ORIGIN rpath
03 · .PAW BOUNDARY exit 70 · replayable

Two-way customs, zero silent drift

Keep numpy, pandas, and PIL isolated in .paw modules. Any None, NaN, or type mismatch fuses immediately and writes a deterministic replay snapshot.

pa_boundary_fault.json --mode dev
{
  "direction": "PY_TO_PA_OUT",
  "worker": "np_ops.sum_array",
  "violation": "return: None where f64 declared",
  "in_payload_snapshot": [{
    "type": "buffer<f64>", "values": [1, 2, 3, 4]
  }]
}
04 · AI-NATIVE WORKFLOW
pa-coder py-to-pa cpp-to-pa

First-class AI skills & JSON repair tickets

Ships with three coding-agent skill packs and a machine-readable diagnostic mode. pac check --ai-diagnostic outputs self-contained repair tickets with inferred context, causal chains, and deterministic patches—including automatic @struct surgery for heterogeneous lists.

$ pac check --ai-diagnostic examples/ exit 1 · 1 ticket
[{
  "code": "PA_E050",  "skill_rule_ref": "pa-coder#borrowing",
  "location": "main.pa:197:18",
  "summary": "callee mutates 'eastings'; caller must pass mut(eastings)",
  "repair_plan": {
    "strategy": "wrap_mut_borrow",
    "suggested_patches": [{ "replace": "eastings=mut(eastings)" }]
  }
}]