4 ms·
Basically the concept of rPython is you write your interpreter in rPython you get a jit for “free”. However your target language doesn’t have to be Python. A l
by asperous 4y ago
Basically the concept of rPython is you write your interpreter in rPython you get a jit for “free”. However your target language doesn’t have to be Python.
A list of rPython projects is here: https://rpython.readthedocs.io/en/latest/examples.html https://rpython.readthedocs.io/en/latest/examples.html
I suppose you could do something similar like writing your interpreter in luaJIT. It’s not clear if rPython is doing anything special to enable jit in the target language but it is designed for this purpose.
- ogogmad 4y agoIs this in answer to my last question? Because I know how RPython works. The question is: Given that meta-tracing is about extending a JIT from a host language to a guest language, could you not then extend the JIT from the guest language to a guest-guest language recursively? You simply have to use annotations (like the start and end of a loop). But the principle stays the same. To experts: Does PyPy enable this at the moment?
- lapinot 4y agoI'm certainly no expert but wrote a small jit in rpython a couple years back. I never heard of any jit driver interface for python (so no for your guest-guest question). I'm not so sure it would be doable, most likely rpython toolchain needs the annotations for loop start & end to be static (eg it's not a function, it's more like a tag in the code). Because how it works is that it compile several versions of your mainloop which splice in complicated ways at these tags. I'm not sure the splicing points could be set dynamically. Otoh, since pypy is trace-jitted, you can hope that a simple interpreter written in python run in pypy will unrolls enough of your python mainloop to actually see some interesting guest program hot-paths and optimize them.. but you're just making it more difficult for the optimizer and it's actually quite simple to write rpython.. Perhaps one should benchmark the brainfuck interpreter in rpython vs run in pypy.