3 ms·
> I'm curious to understand, why is it so hard to write a JIT runtime for python? First, the CPython reference implementation is supposed to be kept simple. Se
by cygx 5y ago
> I'm curious to understand, why is it so hard to write a JIT runtime for python?
First, the CPython reference implementation is supposed to be kept simple. Second, it exposes interpreter implementation details to extension writers, meaning alternative implementations with a radically different architecture might be unable to use some parts of the ecosystem or have to implement costly workarounds (see eg the PyPy FAQ [1]).
[1] https://doc.pypy.org/en/latest/faq.html#do-c-extension-modules-work-with-pypy https://doc.pypy.org/en/latest/faq.html#do-c-extension-modul...
- beagle3 5y agohttps://github.com/microsoft/Pyjion https://github.com/microsoft/Pyjion was a really nice attempt to marry CPython with JIT in a rather generic way, but it was abandoned quickly.
- pansa2 5y agoDevelopment of Pyjion continues here: https://github.com/tonybaloney/Pyjion https://github.com/tonybaloney/Pyjion
- jeltz 5y agoInterestingly Ruby decided to write a JIT despite exposing about as much of the interpreter to extension writers. So far their JIT is not very usegul for most real life workloads but I think that is mostly due to lack of development resources rather than any actual limitations.