4 ms·
Well, CPython probably won't ever get there. But Python as a language maybe could. The GraalPython implementation of Python 3 is built on the JVM, which is a f
by native_samples 5y ago
Well, CPython probably won't ever get there. But Python as a language maybe could.
The GraalPython implementation of Python 3 is built on the JVM, which is a fully thread safe high performance runtime, and Graal/Truffle provide support for speculation on many things. For pure Python it provides a 5-7x speedup already and the implementation is not really mature. Although at the moment they're working on compatibility, in future it might be possible to speculatively remove GIL locks because you have support for things like forcing JITd code to a safepoint and discarding it, if you want to change the basic semantics of the language.
- salawat 5y agoThis is different from Jython, correct?
- native_samples 5y agoIt's sort of taking Jython's implementation approach to a much greater extreme, and bypassing bytecode, so it isn't limited by the Java semantics anymore. It resolves a few big problems Jython had: - GraalPython is Python 3, not Python 2 - It can use native extensions that plug into the CPython interpreter like NumPy, SciPy etc. The C code is itself virtualized and compiled by the JVM!
- salawat 5y agoNeat! Now that I've gotta check out!
- kaba0 5y agoHow does it relate to PyPy? I read that the latter uses tracing JIT, while GraalPython builds on truffle’s AST-based one, that basically maps the JVM’s primitive structures to Python’s and thus making use of all the man-hours that went into the JVM’s development. But last time I checked, pypy had much better performance than Graal, even though TruffleJS (javascript interpreter built on the same model as graalpython) has comparable performance to the v8 engine for long running code. Though the latter is the most actively developed truffle language, let me add that.