[Python-ideas] Add GraalPython to the list of Python implementations

James Lu jamtlu at gmail.com
Thu May 23 16:00:06 EDT 2019


https://github.com/graalvm/graalpython
https://www.python.org/download/alternatives/

GraalPython is an implementation on the Truffle VM, by Oracle Labs. The
Truffle
VM gives Python high-performance interoperability with other languages-
including JVM, LLVM, Ruby, and JavaScript. The Truffle VM is an "AST
Interpreter," which I think means that it executes an interpreter over AST
nodes, then compiles and inlines those nodes to machine code as necessary.

By default, Truffle VM with the Graal JIT enabled. The Graal JIT compiles
the
AST down to machine code.


My personal experiences with the Truffle JavaScript show that it uses
significantly more memory than V8, while having lower performance on pure
JavaScript. This might be different for GraalPython, however.

Converting a JavaScript data structure into a C struct allowed
computation-intensive JavaScript code to use ~30% less cpu power. I don't
really
know if this is already possible in Python through Python's built-in C
extensions. (Since CPython still has to go through its normal dot attribute
lookup machinery, I'd imagine the performance benefits of converting a
Python
class to a C struct would be little.)

TL;DR: GraalPython is a Python implementation with a JIT, an easy way to
add C
extensions, and an easily extensible AST interpreter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190523/a18f9742/attachment.html>


More information about the Python-ideas mailing list