TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A high-performance, zero-overhead, extensible Python compiler using LLVM

241 pointsby wspeirs8 months ago

20 comments

haberman8 months ago
&gt; Non-goals: 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&#x27;t support these in Codon.<p>This is targeting a Python subset, not Python itself.<p>For example, something as simple as this will not compile, because lists cannot mix types in Codon (<a href="https:&#x2F;&#x2F;docs.exaloop.io&#x2F;codon&#x2F;language&#x2F;collections#strong-typing" rel="nofollow">https:&#x2F;&#x2F;docs.exaloop.io&#x2F;codon&#x2F;language&#x2F;collections#strong-ty...</a>):<p><pre><code> l = [1, &#x27;s&#x27;] </code></pre> It&#x27;s confusing to call this a &quot;Python compiler&quot; when the constraints it imposes pretty fundamentally change the nature of the language.
评论 #41584219 未加载
评论 #41591353 未加载
评论 #41584969 未加载
评论 #41589752 未加载
评论 #41584140 未加载
评论 #41584227 未加载
Lucasoato8 months ago
&gt; Is Codon free? Codon is and always will be free for non-production use. That means you can use Codon freely for personal, academic, or other non-commercial applications.<p>I hope it is released under a truly open-source license in the future; this seems like a promising technology. I&#x27;m also wondering how it would match C++ performance if it is still garbage collected.
评论 #41581928 未加载
actionfromafar8 months ago
I immediately wonder how it compares to Shedskin¹<p>I can say one thing - Shedskin compiles to C++, which was very compelling to me for integrating into existing C++ products. Actually another thing too, Shedskin is Open Source under GPLv3. (Like GCC.)<p>1: <a href="https:&#x2F;&#x2F;github.com&#x2F;shedskin&#x2F;shedskin&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;shedskin&#x2F;shedskin&#x2F;</a>
评论 #41581034 未加载
amelius8 months ago
The challenge is not just to make Python faster, it&#x27;s to make Python faster __and__ port the ecosystem of Python modules to your new environment.
评论 #41593423 未加载
评论 #41590933 未加载
veber-alex8 months ago
What&#x27;s up with their benchmarks[1], it just shows benchmark names and I don&#x27;t see any numbers or graphs. Tried Safari and Chrome.<p>[1]: <a href="https:&#x2F;&#x2F;exaloop.io&#x2F;benchmarks&#x2F;" rel="nofollow">https:&#x2F;&#x2F;exaloop.io&#x2F;benchmarks&#x2F;</a>
评论 #41583490 未加载
评论 #41588149 未加载
w10-18 months ago
Unclear if this has been in the works longer as the graalvm LLVM build of python discussed yesterday[1]. The first HN discussion is from 2022 [3].<p>Any relation? Any comparisons?<p>Funny I can&#x27;t find the license for graalvm python in their docs [2]. That could be a differentiator.<p>- [1] GraalVM Python on HN <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41570708">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41570708</a><p>- [2] GraalVM Python site <a href="https:&#x2F;&#x2F;www.graalvm.org&#x2F;python&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.graalvm.org&#x2F;python&#x2F;</a><p>- [3] HN Dec 2022 <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33908576">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33908576</a>
评论 #41582976 未加载
评论 #41587609 未加载
codethief8 months ago
Reminds me of these two projects which were presented at EuroPython 2024 this summer:<p><a href="https:&#x2F;&#x2F;ep2024.europython.eu&#x2F;session&#x2F;spy-static-python-lang-fast-as-c-pythonic-as-python" rel="nofollow">https:&#x2F;&#x2F;ep2024.europython.eu&#x2F;session&#x2F;spy-static-python-lang-...</a><p><a href="https:&#x2F;&#x2F;ep2024.europython.eu&#x2F;session&#x2F;how-to-build-a-python-to-c-compiler-out-of-spare-parts-and-why" rel="nofollow">https:&#x2F;&#x2F;ep2024.europython.eu&#x2F;session&#x2F;how-to-build-a-python-t...</a><p>(The talks were fantastic but they have yet to upload the recordings to YouTube.)
timwaagh8 months ago
It&#x27;s a really expensive piece of software. They do not publish their prices because of it. I don&#x27;t think it&#x27;s reasonable to market such products onto your average dev because of it. Anyhow Cython and a bunch of others provide a free and open source alternative.
albertzeyer8 months ago
There is also RPython (used by PyPy) (<a href="https:&#x2F;&#x2F;rpython.readthedocs.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rpython.readthedocs.io&#x2F;</a>), which is a strict subset of Python, allowing for static analysis, specifically for the translation logic needed by PyPy. Thus, I was told that RPython is not really intended as a general purpose language&#x2F;compiler but only really specifically to implement sth like PyPy.<p>But it&#x27;s anyway maybe an interesting comparison to Codon.
jay-barronville8 months ago
Instead of building their GPU support atop CUDA&#x2F;NVIDIA [0], I’m wondering why they didn’t instead go with WebGPU [1] via something like wgpu [2]. Using wgpu, they could offer cross-platform compatibility across several graphics API’s, covering a wide range of hardware including NVIDIA GeForce and Quadro, AMD Radeon, Intel Iris and Arc, ARM Mali, and Apple’s integrated GPU’s.<p>They note the following [0]:<p>&gt; The GPU module is under active development. APIs and semantics might change between Codon releases.<p>The thing is, based on the current syntax and semantics I see, it’ll almost certainly need to change to support non-NVIDIA devices, so I think it might be a better idea to just go with WebGPU compute pipelines sooner rather than later.<p>Just my two pennies…<p>[0]: <a href="https:&#x2F;&#x2F;docs.exaloop.io&#x2F;codon&#x2F;advanced&#x2F;gpu" rel="nofollow">https:&#x2F;&#x2F;docs.exaloop.io&#x2F;codon&#x2F;advanced&#x2F;gpu</a><p>[1]: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;webgpu" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;webgpu</a><p>[2]: <a href="https:&#x2F;&#x2F;wgpu.rs" rel="nofollow">https:&#x2F;&#x2F;wgpu.rs</a>
评论 #41587735 未加载
评论 #41599263 未加载
GTP8 months ago
People that landed here may be interested in Mojo [0] as well.<p>[0] <a href="https:&#x2F;&#x2F;www.modular.com&#x2F;mojo" rel="nofollow">https:&#x2F;&#x2F;www.modular.com&#x2F;mojo</a>
ipsum28 months ago
Previous discussion (2022): <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33908576">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33908576</a>
big-chungus48 months ago
so, assuming I don&#x27;t get integers bigger than int64, and don&#x27;t use the order of build in dicts, can I just use arbitrary python code and use it with codon? Can I use external libraries? Numpy, PyTorch? Also noticed that it isn&#x27;t supported on windows
shikon78 months ago
From the documentation of the differences with Python:<p>&gt; Strings: Codon currently uses ASCII strings unlike Python&#x27;s unicode strings.<p>That seems really odd to me. Who would use a framework nowadays that doesn&#x27;t support unicode?
Sparkenstein8 months ago
Biggest problem at the moment is async support, I guess<p><a href="https:&#x2F;&#x2F;github.com&#x2F;exaloop&#x2F;codon&#x2F;issues&#x2F;71">https:&#x2F;&#x2F;github.com&#x2F;exaloop&#x2F;codon&#x2F;issues&#x2F;71</a>
zamazan4ik8 months ago
I hope one day the compiler itself will be optimized even more: <a href="https:&#x2F;&#x2F;github.com&#x2F;exaloop&#x2F;codon&#x2F;issues&#x2F;137">https:&#x2F;&#x2F;github.com&#x2F;exaloop&#x2F;codon&#x2F;issues&#x2F;137</a>
tony-allan8 months ago
I would love to see LLVM&#x2F;WebAssembly as a supported and documented backend!
xiaodai8 months ago
Please stop trying to make python fast. Move over to Julia already.
jitl8 months ago
What’s the difference between this and Cython? I think another comment already asks about shedskin.
评论 #41582526 未加载
评论 #41581976 未加载
mgaunard8 months ago
aren&#x27;t there like a dozen of those already?<p>numba, cython, pypy...