Pa
Python-syntax, C++-memory-layout, LLVM-compiled systems language with typed .paw bridges to the Python ecosystem.
Website ·
Quickstart ·
Architecture ·
Changelog
Installation & Minimal Example
Requires Linux x86-64, macOS, or Windows x64, CPython 3.11–3.13 (headers + shared Python library), and a C compiler (gcc, clang, or MSVC cl).
pip install pa-compiler # installs `pac`
pac skill --install claude # optional: install AI skills (also: cursor, codex, copilot, antigravity)
Create hello.pa:
def sum_squares(n) -> int:
total = 0
for i in range(n):
total += i * i
return total
def main() -> int:
print(sum_squares(100000))
return 0
Compile and run:
pac build hello.pa --mode prod -o hello && ./hello
For .paw Python bridges, --relocatable bundles, pac doctor, and --shared C-ABI builds, see the full guide at https://palang.dev/quickstart.
Repository Layout
pa/
├── pa_lang/
│ ├── types.py, validator.py, infer.py # Front-end: subset checks, bidirectional inference, escape analysis
│ ├── paw.py, diagnostics.py # .paw header parser/linter & AI JSON repair tickets
│ ├── codegen.py, build.py # LLVM IR emission (llvmlite), -O2 object build, gcc link, @export
│ ├── runtime_core.c, runtime_bridge.c # RAII fault/print core & embedded CPython zero-copy .paw bridge
│ ├── cli.py, doctor.py, skills_cmd.py # `pac` CLI: check, build, doctor, bundle, skill
│ ├── lsp_server.py # Auto-reloading LSP server (inlay hints, hover memory audit cards)
│ └── skills/ # Bundled SKILL.md assets shipped inside the wheel
├── skills/ # Source AI skills (pa-coder, py-to-pa, cpp-to-pa)
├── vscode-pa/ # VS Code extension (TextMate grammar, LSP client, grammar tests)
├── examples/ # pipeline_demo, hashlib_pa (Python port), raytracer (C++ port)
├── site/ # palang.dev static site (index, quickstart, architecture)
└── tests/ # Pytest suites (front-end, codegen, hardening, LSP, doctor, skill)
Building from Source & Testing
git clone https://github.com/cyyier/pa.git && cd pa
uv venv --python 3.12 .venv # or any CPython 3.11–3.13 with Python.h + shared libpython
source .venv/bin/activate
pip install -e ".[dev]"
pac doctor # verify gcc, llvmlite, Python.h, shared libpython
pac check examples tests # run Pa front-end checks
pytest -q # run full compiler, runtime, LSP, doctor, and CLI test suite
(cd vscode-pa && npm test) # run VS Code TextMate grammar tests
Status & Roadmap
Current (v0.1.0 alpha):
- Supported: Linux x86-64, macOS (arm64 / x86-64), Windows x64, CPython 3.11–3.13,
gcc/clang/ MSVCcl, LLVM viallvmlite. - Included: zero-annotation
.pacompiler (int/uint/float/bool, explicit widthsint32/uint8/uint32/uint64/float32+ short aliasesi32/u8/u32/u64/f32,**, zero-copystr_viewslicing,@struct, stack/RAIIVec, flat CSRVec[Vec[T]],String,libm, multi-file.pamodule imports via local dirs /-I/PA_PATH/ pip packages),.pawzero-copy CPython bridge with two-way customs,--sharedguarded C-ABI libraries,pac doctor/pac bundle(ELF / Mach-O / PE),pac skill,pac lsp, and VS Code extension.
Planned:
- Standalone ecosystem packages (
pa-libs) for common data, geometry, and parsing libraries (powered by multi-file.pamodule imports). - (Low priority) Nested
Vecfields inside@structwith recursive RAII destructors (Pa recommends flat SoA arrays or CSRVec[Vec[T]]).
Non-goals (won't do):
- Static
libpythonlinking for single-file self-contained binaries — standard Python distributions do not ship portablelibpython.a(especially on Windows/macOS), and third-party Python C extensions (.pyd/.sosuch as NumPy) require dynamiclibpython. Usepac build --bundle --with-stdlibfor self-contained directory distribution.
License
MIT — see LICENSE. Release process: RELEASING.md.
Metadata
Release files for pa-compiler 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pa_compiler-0.1.0.tar.gz | 145.7 kB | With provenance | Details for pa_compiler-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pa_compiler-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pa_compiler-0.1.0-py3-none-any.whl |
Total release size: 249.5 kB
Release files / pa_compiler-0.1.0.tar.gz
| Download URL | pa_compiler-0.1.0.tar.gz |
|---|---|
| Size | 145.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f8c25f1cd460857968e1575cdd1e626a0375a40ac2d2595330064931d851bfd
|
|
BLAKE2b-256 checksum How to use checksums |
d233b6f9a547bd8a78518d1e9936309b3455a6e846698e7873327e82aae09b21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logRelease files / pa_compiler-0.1.0-py3-none-any.whl
| Download URL | pa_compiler-0.1.0-py3-none-any.whl |
|---|---|
| Size | 103.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7e1fbe334f138ae8675022c24dcae39f465f4dd475960fe08c8087ae08f4d61
|
|
BLAKE2b-256 checksum How to use checksums |
b4684b61906f872b288a45074c7a4f7b7310b5357d7b21c80d994f73353defac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logSecurity for pa-compiler 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pa_compiler-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.