3 ms·
PyPy looks interesting and it leaves me with a bunch of questions: Is PyPy used a lot? Why don't we hear more about it? Does it support the same large ecosyste
by amelius 2y ago
PyPy looks interesting and it leaves me with a bunch of questions:
Is PyPy used a lot? Why don't we hear more about it? Does it support the same large ecosystem of packages? And does it have a GIL?
- frontalier 2y agoit has a GIL; it supports all pure python packages; it has decent support for packages with compiled code, particularly the more popular ones pypy is used in some interesting places; at some point development was sponsored by a sports betting arbitrage company; you can research a bit more starting from https://pypy.org/pypy-sponsors.html https://pypy.org/pypy-sponsors.html and reading the links from https://pypy.org/categories/sponsors.html https://pypy.org/categories/sponsors.html
- amelius 2y agoThanks. One more question, I see that PyPy supports the CPython C API, so why aren't all compiled packages automatically supported?
- frontalier 2y agoi don't know enough to properly answer this take a look at: https://doc.pypy.org/en/latest/cpython_differences.html#c-api-differences https://doc.pypy.org/en/latest/cpython_differences.html#c-ap...
- crustycoder 2y agoAnother option is GraalPy (https://www.graalvm.org/python/ https://www.graalvm.org/python/) which is a Python JIT compiler. I've used it to embed an entire Python runtime in an application that's written in Scala which I then compiled to a native executable (https://www.graalvm.org/latest/reference-manual/native-image/ https://www.graalvm.org/latest/reference-manual/native-image...) ending up with a zero-dependency single-file application that can execute and interact with arbitrary Python scripts. As pointless benchmarks seem to be the thing, here's the numbers for different flavours of the one from the article with "10 20 30 40 50" as the args to make it a teeny bit more realistic: C 27sec Java 39sec 1.4x C GraalPy 139sec 5.1x C PyPy 252sec 9.3x C CPython 1780sec 66.3x C Not that this will tell you much about real-world use cases, of course, but hell, it's Friday afternoon...