Live data from Hacker News

Codon: A high-performance Python-like compiler using LLVM

github.com

81–90 of 184 posts

Re: Codon: A high-performance Python-like compiler using LLVM

#81
post #67

What's the difference with mypyc [0] ? It also compiles Python to native code. [0]: https://github.com/mypyc/mypyc

the last commit to it's repo was 2 years ago.

> The mypyc implementation and documentation live in the mypyc subdirectory of the mypy repository. > Since mypyc uses mypy for type checking, it's convenient to use a single repository for both. > Note that the mypyc issue tracker lives in this repository! Please don't file mypyc issues in the mypy issue tracker.

See https://github.com/mypyc/mypyc/blob/master/show_me_the_code....

Re: Codon: A high-performance Python-like compiler using LLVM

#84
post #42

power of Python is in ecosystem of libraries, not only Python syntax. Without the ecosystem of libraries, I am afraid use cases for Codon will be very very limited. Because Python developers (just like Node) got used to thinking: Need to do X? Lets see if I can pip install library that does it. Ultimately, python is like super flexible glue between ecosystem of libraries that lets anyone build and prototype high qual…

If Codon becomes similar enough to Python, it will be trivial to port Python libs to it, thus opening Codon to the vast Python ecosystem.

The only trivial thing in software is hello world, anything more complicated or useful for end users is usually far from being trivial, in my experience.

Re: Codon: A high-performance Python-like compiler using LLVM

#85
post #61

I want the opposite. Is there a project that compiles to python (either source or bytecode)? Sort of a graalvm for python?

WebAssembly? Try compiling something to WebAssembly and running it in python?

I haven't thought of that. It's a good idea. I know how to compile to WebAssembly but how do I run it in python?

A quick search leads to pywasm and it is even native python. But is it usable? Any other options?

Re: Codon: A high-performance Python-like compiler using LLVM

#86
post #50
post #9

would love to see actual benchmarks

Don't have anything significant, but giving this a quick test with some of my advent of code solutions I found it to be quite a bit slower: time python day_2.py ________________________________________________________ Executed in 57.25 millis fish external usr time 25.02 millis 52.00 micros 24.97 millis sys time 25.01 millis 601.00 micros 24.41 millis time codon run -release day_2.py _________________________________…

It looks like you are compiling and running. Try compiling to an executable and then benchmark running that

Re: Codon: A high-performance Python-like compiler using LLVM

#87

Free for non-production use... it's a "no" for me.

Surprised this sentiment is so common. It's like, do you want open source devs to work for free forever? Even Redis had to pivot to a business license. I'm not sure what the terms are in this particular case, but in general, wanting someone to pay if they're deploying it to lots of customers seems reasonable.

I can swap one load balancer or cache for another. However, if my programming language has unfavourable terms I will have to rewrite all my code. Oh, and the knowledge I gained will be non transferable to another job or project because it'll always be a niche language. Better to spend the time learning how to get the same performance out of Numba or whatever other alternatives people mentioned here.

By the way, Redis is still BSD licensed.

Re: Codon: A high-performance Python-like compiler using LLVM

#88

Since Codon performs static type checking ahead of time, a few of Python's dynamic features are disallowed. For example, monkey patching classes at runtime (although Codon supports a form of this at compile time) or adding objects of different types to a collection. This seems like a very different language from Python if it won't let you do: [1, 'a string']

I welcome this change. I am willing to sacrifice a few Python features for the sake of speed.
Post reply on HN