The challenge is to stop and save a running script. This is something that is relatively easy done with their scripting language, but it becomes trickier with the CLI.
Their implementation instruments the generated CIL assembly to allow any script to suspend itself and resume execution on demand. This is a bit like continuations, the main difference is that the script does not control when it is suspended, the runtime does. The instrumentation basically checks on every back-branch and on every call site whether the script should stop (in Jim’s words, “eventually, you run out of method, or you run out of stack”) and if it must stop, it jumps to the end of the method where a little stub has been injected that saves the state in a helper class and returns.
A very clever idea. Hopefully the slides for the presentation will be posted soon.
I’d very much like to have attended that presentation, and I’d be interested in seeing those slides as well.
Following my attorney’s advise I have obtained a Second Life account.
Welcome to Second Life, Miguel!
(Link stolen from Baba Sucks.)