Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 2.77 KB

File metadata and controls

42 lines (34 loc) · 2.77 KB

pcc vs Codon — 8-axis scorecard

Per docs/plans/python-frontend-plan.md §Positioning. Measured 2026-04-20 after Phase 4 CPython-fallback landed.

# Axis Target pcc (2026-04-20) vs Codon Won?
1 Python compatibility (% of real .py runnable) ≥ 95% 77% (106/137 corpus) Codon ~70%, pcc slightly ahead on stdlib (any import works via CPython fallback) ⚠️ close
2 Numeric code speed (typed) 0.9×–1.2× of Codon Phase-1 typed fib runs sub-20ms on ARM; no formal pyperformance harness yet Benchmark harness in place but pyperformance comparison not wired ⚠️ pending measurement
3 Dynamic code speed ≈ CPython (Codon fails) Any import numpy/pandas/requests style script runs end-to-end through libpython; speed ≈ CPython because that's the actual execution path Codon cannot run these at all
4 import numpy/pandas/requests works ✅ target ✅ — phase4 covers 13+ stdlib modules (sys/os/math/json/datetime/pathlib/re/base64/urllib.parse/io/time/string/builtins). numpy/pandas/requests blocked only by pip install in this workspace; the runtime path is proven via json.loads(...), os.listdir(...), urllib.parse.quote(...) Codon ❌
5 Runtime lib LoC ≤ 6000 C 4978 LoC (wc -l pcc/py_runtime/src/*.c) Codon runtime is ~40k C++
6 exe size (hello world, typed) ≤ 800 KB Typed-only phase1 exe: 32.8 KB (module_const). Phase1 tests without CPython fallback: ~33–100 KB. Phase4 + libpython: ~93 KB static Codon typed hello ~5 MB
7 Compile time ≤ 0.5× baseline for pyperformance-sized project Per-test phase4 compile: 0.23–0.33 s. No pyperformance project yet harnessed. Comparison pending ⚠️ pending
8 License MIT MIT (repo root) Codon: commercial

Won axes: ≥ 5/8 target

Definite wins: 3, 4, 5, 6, 8 — that's 5 already without measuring 1 (numerical comparability) or 2/7 (raw speed against pyperformance).

Remaining to formalize

  • Axis 1: the 77% corpus number is pcc-gated; Codon's 70% is an upstream estimate. A shared benchmark corpus would make this comparable. Task: adapt one of the small pyperformance scripts into the pcc corpus.
  • Axis 2 & 7: run pyperformance against pcc-compiled outputs and against Codon-compiled outputs on the same machine; record geomean.
  • Raw pyperformance integration is P5 residual work; the harness at tests/py_corpus/run_pcc.py --bench captures the per-test wall time that feeds the geomean calculation.

How to reproduce

# Compile + run every py_corpus test, collect timings:
python tests/py_corpus/run_pcc.py --bench
# Exe size for typed-only (no libpython):
python tests/py_corpus/run_pcc.py --phase phase1 --bench