postpile
Typed Python, compiled to native code, held to what CPython prints.
Open source, under Apache 2.0. It builds on postpyc, the POST Python reference compiler.
Fast Python usually means leaving Python.
The hot loop moves to C, to a dialect, or to a JIT for numeric kernels. Then two versions must agree. Some also give a slightly different answer.
Every build is held to CPython's output.
CPython is the reference. Tests run each program under both and compare.
- Three native backends, C, QBE and LLVM, from one typed IR
- Output compared byte for byte with CPython's
- Expected values come from CPython, never written by hand
What it cannot compile exactly, it refuses.
No silent approximation. Each diagnostic names the line and the reason, and often the fix.
- A code for each kind of diagnostic
ppc checkreports them all before any build- Rejecting well-typed code counts as a gap to close
Close to C, far ahead of CPython.
On thirteen low-level programs, the C backend's code takes 1.15 times C's time, as a geometric mean.
- No program more than twice C's time
- CPython takes 65 times C's time on the same set
- Every timed run prints CPython's output
One compiler, many ways in.
Executables and extensions
Whole scripts become executables, modules become Python extensions or NumPy ufuncs.
Python in both directions
Compiled code calls Python libraries, and Python imports compiled code.
Concurrency
Channels, task groups and select, on a C runtime.
Measured on real programs
All 28 typed Shed Skin examples compile, and 58 of 104 harvested scripts.
In development, no release yet. Source: git.sr.ht/~sfermigier/postpile
Documentation: postpile.lab.abilian.com