I didn't think continuations were possible on the JVM. Any idea how they're doing this?
I didn't think continuations were possible on the JVM. Any idea how they're doing this?
So it converts your program to continuation-passing style, which you can do in any environment if you're willing to mangle the program enough. I would not expect it to be fast.
It certainly won't be quite as fast as idiomatic Java code, but it should be considerably faster than other non-local exit implementations that rely on exception handling to manipulate the stack.
It sounds like you will only be able to do continuations within Scala code, not over a call-stack that includes Java/Scala transitions.
(...which is entirely feasible. After all, many interpreters for continuation-friendly languages are built on top of C, which has no continuations.)