[HN Gopher] Codon: Python Compiler
___________________________________________________________________
Codon: Python Compiler
Author : joak
Score : 9 points
Date : 2023-05-08 20:59 UTC (2 hours ago)
(HTM) web link (www.usenix.org)
(TXT) w3m dump (www.usenix.org)
| debatem1 wrote:
| Last I heard Codon was a _python-like_ language rather than
| actual Python and the author suggests something similar. Headline
| seems pretty misleading.
| netr0ute wrote:
| It was only technically python-like, but enough like it that
| you could conceivably call them the same thing.
| [deleted]
| joak wrote:
| If it accepts a subset of python it's technically python: any
| codon-python program is a python program. Not full python but
| python nonetheless...
|
| My understanding:
|
| The goal is not to compile existing python code but to write
| new python code meant to be compiled in order to be faster.
| Limited use, still useful.
| nighthawk454 wrote:
| Repo for more details: https://github.com/exaloop/codon
|
| > What is Codon?
|
| > Codon is a high-performance Python compiler that compiles
| Python code to native machine code without any runtime overhead.
| Typical speedups over 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. Codon grew out of the Seq project.
|
| > What isn't Codon?
|
| > While Codon supports nearly all of Python's syntax, it is not a
| drop-in replacement, and large codebases might require
| modifications to be run through the Codon compiler. For example,
| some of Python's modules are not yet implemented within Codon,
| and a few of Python's dynamic features are disallowed. The Codon
| compiler produces detailed error messages to help identify and
| resolve any incompatibilities.
|
| > Codon can be used within larger Python codebases via the
| @codon.jit decorator. Plain Python functions and libraries can
| also be called from within Codon via Python interoperability.
| voz_ wrote:
| How do you do, fellow python compilers?
___________________________________________________________________
(page generated 2023-05-08 23:00 UTC)