exaloop /codon
A high-performance, zero-overhead, extensible Python compiler with built-in NumPy support
★ 16,861⑂ 606👁 131⑃ 230● 550▤ 27
+0
日增长
-2
周增长
+2
月增长
16,861
stars
606
forks
131
watchers
230
prs
550
issues
27
releases
README
Docs &183; FAQ &183; Blog &183; Discord &183; Roadmap &183; Benchmarks What is Codon? Codon is a high-performance Python implementation that compiles to native machine code without any runtime overhead. Typical speedups over vanilla Python are on the order of 10-100x or more, on a single thread. Codon's performance is typically on par with (and sometimes better than) that of C/C++. Unlike Python, Codon supports native multithreading, which can lead to speedups many times higher still. Think of Codon as Python reimagined for static, ahead-of-time compilation, built from the ground up with best possible performance in mind. Goals - :bulb: No learning curve: Be as close to CPython as possible in terms of syntax, semantics and libraries - :rocket: Top-notch performance: At least on par with low-level languages like C, C++ or Rust - :computer: Hardware support: Full, seamless support for multicore programming, multithreading (no GIL!), GPU and more - :chart_with_upwards_trend: Optimizations: Comprehensive optimization framework that can target high-level Python constructs and libraries - :battery: Interoperability: Full interoperability with Python's ecosystem of packages and libraries Non-goals - :x: Drop-in replacement for CPython: Codon is not a drop-in replacement for CPython. There are some aspects of Python that are not suitable for static compilation — we don't support these in Codon. There are ways to use Codon in larger Python codebases via its JIT decorator or Python extension backend. Codon also supports calling any Python module via its Python interoperability. See also "Differences with Python" in the docs. - :x: New syntax and language constructs: We try to avoid adding new syntax, keywords or other language features as much as possible. While Codon does add some new syntax in a couple places (e.g. to express parallelism), we try to make it as familiar and intuitive as possible. How it works Quick start Codon runs natively on Linux, macOS, and Windows x86-64. On Linux or macOS, download and install it with: bash /bin/bash -c "$(curl -fsSL https://exaloop.io/install.sh)" On Windows x86-64, run this in PowerShell: powershell & ([scriptblock]::Create((irm https://exaloop.io/install.ps1))) -AddToPath See the installation guide for PATH setup, C++ build tools, and Python package installation. Once installed and added to PATH, the codon command is available to use. For example: - To run a program: codon run file.py - To run a program with optimizations enabled: codon run -release file.py - To compile to an executable: codon build -release file.py - To generate LLVM IR: codon build -release -llvm file.py Many more options are available and described in the docs. Alternatively, you can build from source. Examples Basics Codon supports much of Python, and many Python programs will work with few if any modifica
Top issues
#69windows support31 comments · 2022-12-08#67WebAssembly Support?20 comments · 2022-12-08#759Exception catching is broken in JIT mode11 comments · 2026-02-25#671Memory Leak Detection by LSAN in Single-threaded Context with OpenMP Involvement10 comments · 2025-07-09#848High GC overhead in JIT workload8 comments · 2026-08-19#702Static[int] can't be used in dict, list or tuple8 comments · 2025-10-13#547using protobuf case8 comments · 2024-02-29#82static compilation option?8 comments · 2022-12-10
Discussions
#874We need a slice of Codon PIE2 comments · 2026-10-24#825Python-hosted GPU DSL for Codon kernels0 comments · 2026-06-19#815RFC: Native-backed Python Classes for Codon JIT via `codon.jitclass`3 comments · 2026-05-22#807Compile Time Static Evaluations2 comments · 2026-05-13#806Other Compiler Projects to Borrow Ideas from0 comments · 2026-05-13#790Persistent GPU Memory Buffer Handling0 comments · 2026-04-07#772Design question: where should SPIR-V/OpenCL-specific GPU lowering live in Codon?2 comments · 2026-03-16#745Tail Recursion with Codon1 comments · 2026-02-03
Latest release
v0.20.6 v0.20.6 2026-11-01Full Changelog: https://github.com/exaloop/codon/compare/v0.20.5...v0.20.6