Paper here: "Codon: A Compiler for High-Performance Pythonic Applications and DSLs": https://dl.acm.org/doi/pdf/10.1145/3578360.3580275 "Currently, there are several Python features that Codon does not support. They mainly consist of runtime polymorphism, runtime reflection and type manipulation (e.g., dynamic method table modification, dynamic addition of class members, metaclasses, and class decorators). There are…
Python-based compiler achieves orders-of-magnitude speedups
131–140 of 193 posts
Re: Python-based compiler achieves orders-of-magnitude speedups
#132>“Google users in America have searched for Python more often than for Kim Kardashian.” I wonder how Kim Kardashian programming language looks like. I guess low level but with garbage collector. :D
Since I have the world's greatest creative assistant handy, here's what GPT-4 thinks a Kim Kardashian language would look like: Hey dolls, let me introduce you to the Kimmie programming language, it's like totally fab and easy to use! To declare a variable, just use the hashtag symbol and the variable name, like this: #my_var To assign a value to the variable, use the word "like" followed by the value, like this: #my…
Re: Python-based compiler achieves orders-of-magnitude speedups
#133There are other python implementations like pypy which includes a JIT (Just In Time compiler). There are other jit which can run with official python (cpython) like numba (not all code can be optimized, but if you only need optimize your hot code path). You can use a superset language of python called cython that generate C code. It can be used to generate C bindings or fast python (for cpython) modules implemented i…
Can you use Django with those optimisations or are they good mainly for scientific computing?
Quick, transactional HTTP exchanges (GET, POST, etc.) aren't really its thing-- there's no time for the compiler to get warmed up; the request is complete before pypy has gotten out of bed.
But if you have to do really complex view rendering (graphs or something) where it would take cpython ~10s or more to process, then pypy will leave cpython in the dust.
Re: Python-based compiler achieves orders-of-magnitude speedups
#134Can we please not? Humanity wasted close to 50 years optimizing compilers for one garbage language. Wasted unimaginable efforts, money and developer hours... and all could've been avoided if the same people dedicated a fraction of those resources to language design. Same thing happened with Java. And now the existence of a well-developed compiler became an argument in its own right in favor of choosing a bad language…
It works, it doesn't confuse me, it's easy to find libraries and examples, and when it's too slow -- which is surprisingly rare -- I have other options to turn to. If that's trash then so be it; call me a raccoon because I'm there for the trash.
Re: Python-based compiler achieves orders-of-magnitude speedups
#135Since this is highly incompatible with most python ecosystem right now, may I plug nuitka? https://nuitka.net/index.html It's a compiler for python code that can create stand alone executables, and up to 4 times the speed of the initial code. Best of all, it's extremely reliable, with a high level of support of event the tricky things like the scientic and gui stacks.
Seconded, I deploy large packages with gigabytes of deep learning and GIS dependencies in single executables with Nuitka and it works very well. Also handles including data files into the executable if needed.
Re: Python-based compiler achieves orders-of-magnitude speedups
#136Since this is highly incompatible with most python ecosystem right now, may I plug nuitka? https://nuitka.net/index.html It's a compiler for python code that can create stand alone executables, and up to 4 times the speed of the initial code. Best of all, it's extremely reliable, with a high level of support of event the tricky things like the scientic and gui stacks.
Seconded, I deploy large packages with gigabytes of deep learning and GIS dependencies in single executables with Nuitka and it works very well. Also handles including data files into the executable if needed.
Re: Python-based compiler achieves orders-of-magnitude speedups
#137Python should just have optional compilation built right into the language. Likewise, modern low level languages should have syntactical conveniences and optional whitespace. It’s 2023. We don’t need to keep having this war.
Re: Python-based compiler achieves orders-of-magnitude speedups
#138> Faster than the speed of C One must note that this is impossible, unless you have chosen to handicap the C-implementations while benchmarking. Borderline unethical IMO to put forth such a claim.
So not impossible and therefore not unethical.
Re: Python-based compiler achieves orders-of-magnitude speedups
#139Since this is highly incompatible with most python ecosystem right now, may I plug nuitka? https://nuitka.net/index.html It's a compiler for python code that can create stand alone executables, and up to 4 times the speed of the initial code. Best of all, it's extremely reliable, with a high level of support of event the tricky things like the scientic and gui stacks.
Seconded, I deploy large packages with gigabytes of deep learning and GIS dependencies in single executables with Nuitka and it works very well. Also handles including data files into the executable if needed.
Re: Python-based compiler achieves orders-of-magnitude speedups
#140Since this is highly incompatible with most python ecosystem right now, may I plug nuitka? https://nuitka.net/index.html It's a compiler for python code that can create stand alone executables, and up to 4 times the speed of the initial code. Best of all, it's extremely reliable, with a high level of support of event the tricky things like the scientic and gui stacks.