has 10 years of engineering experience, having been involved in the development of websites, mobile apps, and consumer games. Currently, as a board member at I-Tecnology Co., Ltd., he is engaged in both management and development. He has an interest in open source and has contributed to various projects. GitHub: @eltociear FaceBook: IkkoEltociearAshimine X: @eltociear YouTube: @eltociear
code without any runtime overhead ・Speedups over vanilla Python are on the order of 10-100x or more ・Supports native multithreading ・Extensible via a plugin infrastructure ・Free of charge
a 64-bit signed integer, whereas Python's (after version 3) can be arbitrarily large. ・Codon currently uses ASCII strings unlike Python's unicode strings. ・Since Codon performs static type checking ahead of time, a few of Python's dynamic features are disallowed. ・For performance reasons, some numeric operations use C semantics rather than Python semantics. ・While most of the commonly used builtin modules have Codon-native implementations, a few are not yet implemented. However these can still be used within Codon via from python import. https://docs.exaloop.io/codon/general/differences
syntax, semantics and APIs as closely as possible, aside from a few cases where Codon differs from CPython for performance reasons (one example being Codon's 64-bit int vs. CPython's arbitrary- width int). Performance-wise, speedups over CPython are usually on the order of 10-100x.
JIT decorator similar to Numba's, Codon is in general an ahead-of-time compiler that compiles end-to-end programs to native code. It also supports compilation of a much broader set of Python constructs and libraries.
a drop-in replacement for CPython, whereas Codon differs in a few places in order to eliminate any dynamic runtime or virtual machine, and thereby attain much better performance.
to CPython as possible while still being fully statically compilable. While Codon already supports much of Python, there is still much to be done to fully realize its potential. Here is a high-level roadmap of the things we want to add, implement or explore.
・First-class types and compile-time metaclasses ・Full class member deduction ・Implicit union types to support mixed-type collections ・Variadic type arguments (e.g. Foo[Bar, ...]) 💻Parallelism ・async/await support ・multiprocessing support ・Automatic locking in parallel code (e.g. if mutating a data structure shared between threads) ・Race detection
3.10+: ・Argument separators (/ and *) ・Constructor object matching in the match statement ・Support accessing various object properties (__dict__, __slots__ etc.) as much as possible in a static context 💻Better error messages ・Warning support ・Explain performance considerations ・Explain that a CPython feature is not supported 💻Modules and incremental compilation ・Cache compilation modules ・Fast generics compilation in debug mode for quick turnarounds
GC ・Optional alternative memory management modes like reference counting 💻Optional automatic switching between Codon and CPython (i.e. compile only compatible functions and leave the rest to Python) 💻GPU support ・Target Apple, AMD and Intel GPUs ・GPU-specific compiler optimizations (e.g. for using various Python constructs on the GPU) 💻Interoperability with other languages ・Direct C++ interoperability via Clang ・R interoperability
can be easily accessed via a from python import foo statement, which is sufficient in most cases as many libraries are just thin wrappers around a C library and/or not performance-sensitive.
future, we would like to support the following modules natively: 📚Python's standard library ・Complete builtins support ・1-to-1 compatibility with existing Python functions and modules ・File modules: os, sys, struct, pathlib and so on ・Pretty much everything else on an as-needed basis 📚Native NumPy, Pandas, etc.: Having Codon-native versions of the most popular 3rd-party libraries would allow them to work with Codon's other features like multithreading and GPU. We're currently prioritizing NumPy and Pandas but aim to later target other popular libraries as well. 📚Unicode support 📚Python's testing infrastructure
🛠A sane package manager similar to Rust's Cargo 🛠Auto-detection of installed Python libraries 🛠Improved codon.jit library support ・Better error messages ・Better installation flow 🛠Fully static binary support like Go ・Remove libcodonrt (runtime library) dependency if needed ・Remove libcpp dependency
is and will continue to be free of charge ・Codon can run 10-100 times faster in JIT mode ・Codon can output executables from source ・Many more updates are planned for Codon 6. Conclusion