3 ms·
Is 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
by ogogmad 4y ago
Is 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.