[edit: Changed "host" to "guest"; Python to Python2]
I have a question to the experts though: The principle of meta-tracing suggests you might be able to write your guest language in Python. Is that currently possible with RPython/PyPy?
[edit: Changed "host" to "guest"; Python to Python2]
I have a question to the experts though: The principle of meta-tracing suggests you might be able to write your guest language in Python. Is that currently possible with RPython/PyPy?
A list of rPython projects is here: 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.
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?
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.