News for hackers. Stuff that matters.
Re:By example: Continuation-passing style in JavaScript by agscala on Tuesday November 09, 2010 @12:43PM (#1887225)
Basically, this article is just about what callbacks are and how they are all nice and convenient?
Re:By example: Continuation-passing style in JavaScript by mattmight on Tuesday November 09, 2010 @01:07PM (#1887326)
No. I think you're missing the point.

Continuations become a highly constrained kind of callback in continuation-passing style.

Callbacks by themselves don't make for a nice intermediate format for compilation, or a way to model exceptions or distributed computation.

They only gain these abilities when constrained as continuations in CPS.

Re:By example: Continuation-passing style in JavaScript by silentbicycle on Tuesday November 09, 2010 @03:10PM (#1887733)
For good descriptions of using CPS as an intermediate representation in a compiler, check out Appel's _Compiling with Continuations_, Guy L. Steele's "Rabbit" thesis, Krantz's "Orbit" thesis, and chapter 12 of the first edition of _Essentials of Programming Languages_ (they cut it from later editions, unfortunately). Appel uses ML, the rest use Scheme.
Re:By example: Continuation-passing style in JavaScript by mbrubeck on Tuesday November 09, 2010 @01:04PM (#1887314)
Yes... including how they're "just" nice and convenient as a compilation target for a language with exceptions and continuations.
Re:By example: Continuation-passing style in JavaScript by acconrad on Tuesday November 09, 2010 @12:55PM (#1887280)
Unfortunately, yes.