int3/metajs — pull request #2 by omphalos (2013-02-10 02:53:51+00:00)
Title: Continuation passing style

Hello,

I have created a branch where I changed the interp function to use continuation passing style.

There are many benefits to using continuation passing style for something like this, such as:
* It becomes straightforward to introduce a debugger
* It is possible to instrument running JavaScript
* JavaScript can be run in a custom scheduler
* (and many other things as well)

The downside is that continuation-laden code is not as pretty as code that is continuation-free. I opted for IcedCoffeeScript as the least-bad way to address this, since it's not a big change from CoffeeScript, and is prettier (in my opinion) than many of the other alternatives out there for handling JavaScript continuations.

Overall, I think the added power that continuation passing style gives the interpreter makes it a valuable addition to this project.