News for hackers. Stuff that matters.
Re:By example: Continuation-passing style in JavaScript by masklinn on Tuesday November 09, 2010 @02:06PM (#1887521)
> ECMA doesn't require efficient tail recursion. Caveat programmer.

You can always use setTimeout to call your tail, which has the neat effect that your CPS "threads" become cooperatively multitasked and can progress alongside each other. Just replace "foo()" tail calls with "setTimeout(foo, 0)".

And the downside that you're nuking your stack every time, making debugging quite a bit harder.

Re:By example: Continuation-passing style in JavaScript by silentbicycle on Tuesday November 09, 2010 @07:11PM (#1888569)
CPS is about much more than just callbacks, though.