10
$\begingroup$

The RPython toolchain translates interpreters to JIT compilers. The interpreter may be written in any style; the corresponding JIT compiler is defined by annotations on the main loops of the interpreter.

In practice, there are only two styles of interpreter used with RPython. One is AST walking, which is also the only style supported by the Truffle ecosystem. The other style is bytecode evaluation, as traditionally used by Python implementations like PyPy.

Which other styles of interpreter are supported by RPython? That seems like too open of a question, so I want to ask something narrower: which other styles are not well-supported?

$\endgroup$
5
  • 2
    $\begingroup$ This is well-known folklore in the RPython ecosystem, but I'm hoping for answers from those who are less biased than me. $\endgroup$
    – Corbin
    Sep 19 at 16:48
  • 1
    $\begingroup$ What do you mean by interpreter? By the Church-Turing thesis, you should be able to convert any kind of interpreter into any other kind, no? $\endgroup$ Sep 20 at 9:50
  • $\begingroup$ @MartinBerger: The RPython toolchain can only generate JIT compilers which have a central loop of some sort; the loop is translated into four interpreters which interleave mutation, tracing, and deoptimization for each iteration of the loop. RPython lore is that the only option is bytecode evaluation, but AST-walking is also known to work well. This question is about interpreter styles which are known to not work well. $\endgroup$
    – Corbin
    Sep 20 at 15:39
  • $\begingroup$ Could you give a concrete example of a style of interpreter that you are not sure about suits RPython? $\endgroup$ Sep 20 at 18:58
  • 1
    $\begingroup$ @MartinBerger: Sure! This would also be a good start to an answer. Some FORTH-style threaded interpreters are not suitable, because they don't loop; instead, they jump forward forever. Similarly, Cheney on the MTA (Haskell, CHICKEN Scheme) isn't available, which is a real issue for those languages due to their concurrency primitives and evaluation order. Graph reduction can be done, in contrast. $\endgroup$
    – Corbin
    Sep 21 at 2:06

0

You must log in to answer this question.

Browse other questions tagged .