exaloop /codon

A high-performance, zero-overhead, extensible Python compiler with built-in NumPy support

★ 16,861⑂ 606👁 131⑃ 230● 550▤ 27
PythonApache-2.0Created 2021-09-27docs.exaloop.io
下载:v0.20.6v0.20.6 ↓0.20.62026-11-01
+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

Discussions

Latest release

v0.20.6 v0.20.6 2026-11-01
Full Changelog: https://github.com/exaloop/codon/compare/v0.20.5...v0.20.6

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON