Open ngoodman opened 9 years ago
I remember looking into call/cc a while ago and concluding that it's really hard because V8 doesn't have first-class continuations (although Rhino does).
Maybe not technically impossible though - see some notes from the Racket folks (this looks scary, though)
Once you're in CPS, call/cc is easy (and requires no support from the js compiler); we just have to make sure it plays nice with the control flow of the inference coroutines. For the latter, we need the original continuation to eventually be called, so probably delimitted continuations instead.
Also see #54
Add call/cc or delimited continuations to webppl. This should be pretty easy, since the cps transform should just turn call/cc into something that passes on the continuation...
Use this to explore co-routines and, especially, stochastic futures (see Rictchie, et al, under review). Make a cool interactive procedural model control demo using this.