You can also implement them with a setTimeout(0), which gives the browser's event loop a chance to run so that you don't lock up the browser forever. I did something like this with ArcLite, resetting the stack with a setTimeout(0) after ever top-level definition was parsed, so that it didn't take 30 seconds of unresponsive browser for the standard library to load. It occurred to me afterwards that I could've used this to implement continuations, but by then I was pretty much done with Arc development.
Comments
You can also implement them with a setTimeout(0), which gives the browser's event loop a chance to run so that you don't lock up the browser forever. I did something like this with ArcLite, resetting the stack with a setTimeout(0) after ever top-level definition was parsed, so that it didn't take 30 seconds of unresponsive browser for the standard library to load. It occurred to me afterwards that I could've used this to implement continuations, but by then I was pretty much done with Arc development.
This has actually been done, in Inria's HOP project with Scheme->JS