pyscriptc
pyscriptc

pyscriptc
Compile annotated Python to a native binary.
Get started · GitHub · PyPI
For agents: llms.txt, llms-full.txt
Where it differs from CPython
pyscriptc compiles a typed subset of Python to machine code.
Anything the subset cannot prove is refused with a numbered diagnostic (PSxxxx) that names the
line, or routed to an embedded CPython island inside the same binary.
The rules, the numbered divergences from CPython and the known gaps are in
Divergences from CPython and The Python subset;
the live per-module and per-library status is on the compat site.
Two things to know before you plan around it:
- Annotations are required. A parameter or local without one stops the build (
PS1001). - Code outside the subset does not fail silently, but it does not become native either: it runs on
the island, at interpreter speed, and every call crossing the boundary pays a marshalling cost.
Libraries and fallback mode states what the two planes cost.
Try it now
uv tool install pyscriptc
pyscriptc compile examples/sum_squares.py --run --call sum_squares --args '[10]' -o /tmp/sum_squares
That prints 285, the same value CPython returns, from a native binary.