Full CPS transformation viability when using truffle graalvm?

134 Views Asked by At

I'm working on an interpreter, and just recently discovered graal truffle, which promises fast performance if I use it to implement the interpreter. However, from what I can the mileage varies on the interpreter's code and how easily compiler can optimize it. The interpreter I'm working on has a feature of full continuations, which I implemented using CPS transformation and trampolining for TCO. If I port this to truffle, can I hope for decent performance, or is it something that just won't fundamentally work better than regular interpreter written in java due to architecture of the code?

1

There are 1 best solutions below

0
On

You need to make sure that continuations are constant e.g. partial evaluation must see a "constant" target through the trampoline. I haven't seen a CPS interpreter for GraalVM yet. The interpreter will be probably slower than AST or bytecode interpreters, but the compiled code should be as fast. For further technical questions please check https://github.com/oracle/graal/tree/master/truffle#community