« All posts

Pon: A Rust-Built JIT/AoT Compiler for Python 3.14

Pon is a Rust-based JIT/AoT compiler that skips the CPython interpreter and bytecode entirely, compiling Python 3.14 straight to native code via Cranelift.

Pon is an experimental JIT and ahead-of-time compiler/runtime for Python 3.14, written in Rust, that removes CPython's interpreter and bytecode layer entirely. Source is parsed with the ruff parser, lowered into a single shared IR, and compiled through Cranelift straight to machine code — either run in-process via JIT or emitted as a standalone native executable via the AoT path. Memory is managed by a custom Green Tea garbage collector instead of reference counting, and a tiered JIT (a boxed tier-0 baseline plus a typed tier-1 with inline caches and on-stack replacement) speeds up hot code using runtime type feedback.

Correctness is enforced through a strict differential contract against CPython 3.14.0: every corpus module must produce byte-identical output, passing modules are locked into CI-checked floor files, and any regression below that floor fails the build. Separate fuzzing and threading stress suites are held to a zero-divergence bar as well.

Today 209 of 244 tracked modules pass under the JIT and 172 of 206 pass when compiled AoT, matching CPython exactly. The big remaining work is running CPython's own full test suite and building out native stdlib modules (io, os, json, datetime, and more). Pon also ships a uv-style package manager, though it isn't yet wired into the core correctness gates. The stated end goal is to become the bun/v8 equivalent for Python — single-binary native executables, a multi-tier JIT that outruns CPython, and batteries-included tooling.