Live data from Hacker News

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

github.com

121–130 of 184 posts

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

#121
post #36

Earlier quoted context omitted.

JIT.

JIT can be faster than a static compiler if it takes advantage of runtime feedback, but that's not the case here: > While Codon does offer a 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 can be, but if you're using PGO, the performance gains from JIT are a lot less significant and you lose the compilation overhead at runtime that you have with JIT.

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

#123
Anybody claiming it's almost Python is kidding themselves. This compiler needs to do static type checking. This is inherently impossible in Python. Not just because of some obscure corner cases that nobody uses. It's baked into the language itself.

Reality-check: Why do you think type hints and type checkers like mypy and pyright take such a long time to get going and even they are not there yet? If this was all so easy with just ignoring some obscure rarely used features then mypy would work with essentially no type annotations, all just automatic inferences. Anybody who has tried to work with type annotations in Python knows how hard this is.

So, those guys are quite obviously overselling their product. I can understand it, academic life is hard, and once you've completed your Ph.D., what can you do. You need to stand out. But these claims don't pass the smell test, sorry.

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

#124
post #93

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 have been using Python since 25 years, and never needed that one.

You've never had to read arbitrary json?

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

#126

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.

> Even Redis had to pivot to a business license.

Wrong, Redis has a BSD-3 license: https://github.com/redis/redis

Optional add-ons to Redis may have non-free licenses.

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

#127

Earlier quoted context omitted.

I got a massive jump in performance when moving from Python 3.8 to 3.10 (over some function call optimizations I think, based on the project). And 3.11 got even better (up to 50% faster on special cases, and 10~15% on average) with respect to 3.10. Python 3.12 is already getting even more speedups and a there's a lot more down the road[0]. But Python core developers value keeping "not breaking anyones code" (Python 3…

Interesting. What is the status of the GIL these days?

Exactly the same as it ever was, but if you're doing cpu-heavy stuff on python objects you're doing it wrong because they'll never be Fast.

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

#128

Earlier quoted context omitted.

In 25 years you’ve never once created a list with more than one type of object in it?

Maybe a list with ThingObject or None, but my lists are usually homogenous.

thats just homogenous Sequence[Optional[T]], though.

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

#129
post #124
post #93

Earlier quoted context omitted.

I have been using Python since 25 years, and never needed that one.

You've never had to read arbitrary json?

I just did a quick check (apparently DuckDuckGo has a built in JSON validation function lol love it) and `[1, "foo"]` does pass their JSON validation.

Not surprised but I did want to confirm.

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

#130

Anybody claiming it's almost Python is kidding themselves. This compiler needs to do static type checking. This is inherently impossible in Python. Not just because of some obscure corner cases that nobody uses. It's baked into the language itself. Reality-check: Why do you think type hints and type checkers like mypy and pyright take such a long time to get going and even they are not there yet? If this was all so e…

What about GraalVM? Are they overselling, too?
Post reply on HN