Earlier quoted context omitted.
I have been using Python since 25 years, and never needed that one.
You never implemented a quick polish notation calculator that uses this data structure? [1,2, '+']
Codon: A high-performance Python-like compiler using LLVM
161–170 of 184 posts
Re: Codon: A high-performance Python-like compiler using LLVM
#162Thanks a lot for all the comments and feedback! Wanted to add a couple points/clarifications: - Codon is a completely standalone (from CPython) compiler that was started with the goal of statically compiling as much Python code as possible, particularly for scientific computing use cases. We're working on closing the gap further both in what we can statically compile, and by automatically falling back to CPython in c…
What technical limitations does an import or 3rd party add that a script wouldn't have?
Re: Codon: A high-performance Python-like compiler using LLVM
#163Thanks a lot for all the comments and feedback! Wanted to add a couple points/clarifications: - Codon is a completely standalone (from CPython) compiler that was started with the goal of statically compiling as much Python code as possible, particularly for scientific computing use cases. We're working on closing the gap further both in what we can statically compile, and by automatically falling back to CPython in c…
Im curious. If codon can compile a python script, why can it not compile a pure python library? What technical limitations does an import or 3rd party add that a script wouldn't have?
Re: Codon: A high-performance Python-like compiler using LLVM
#164I want the opposite. Is there a project that compiles to python (either source or bytecode)? Sort of a graalvm for python?
Re: Codon: A high-performance Python-like compiler using LLVM
#165Re: Codon: A high-performance Python-like compiler using LLVM
#166Just out of curiosity: Why is it possible to compile Common Lisp Code (or Scheme, or Clojure) to high-performance native or jit-compiled code, but not Python? It is said that "Python is too dynamic", but is not everything in Lisp dynamic, too? And none of these languages is less powerful than Lisp, lack Unicode support, or whatever, so this can't be the reason.
It’s because Python object attributes can change any time, as they are accessed dynamically. Nothing can be inlined easily. The object structure is pointer heavy. Here is some old 2014 post: http://jakevdp.github.io/blog/2014/05/09/why-python-is-slow/ As other commenters pointed out, some of these Python features, which are unused 99,99% time, could be sacrified for additional speedup by breaking backwards compatibil…
It is more a matter of wanting to have a JIT in the box or not.
Re: Codon: A high-performance Python-like compiler using LLVM
#167Earlier quoted context omitted.
I can't think of a time I ever needed to do such a thing, and I've written many thousand lines of python. Python supports OOP, so classes will get you quite far in this regard.
Wouldn't that exclude (most) nested lists?
Re: Codon: A high-performance Python-like compiler using LLVM
#168Re: Codon: A high-performance Python-like compiler using LLVM
#169Earlier quoted context omitted.
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
#170Unfortunately stuff like this never makes it to the upstream. And i am afraid to ask why. We had pypy for years, but never got merged with python. That is why there are still minor incompatibilities between pypy and "The Python", so it's not that useful as it might have been if it got merged with cpython at some point.
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…
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=python3.9&...