Lambda the Ultimate

inactiveTopic Continuations
started 4/4/2003; 5:14:27 AM - last post 4/4/2003; 9:38:29 AM
andrew cooke - Continuations  blueArrow
4/4/2003; 5:14:27 AM (reads: 402, responses: 3)
A good description of continuations (parts 1, 2a, 2b, 2c).

[from a post to python-dev; not posted to front page because it may be a duplicate - haven't been reading lately]

It strikes me (at last!) that "continuation" is used in two different ways. First (eg the "Continuations in Java" paper recently), as "the ('ordinary') function you call next. I'd call this "weak continuations". If program state over time is viewed as a tree then weak continuations don't allow you to jump to arbitrary nodes - you traverse the tree recursively (and so can use a stack to store program state). Then, second, there's "strong continuations", as described in these links, where that function includes the program state (including call path). Calling such a function replaces the call path and so allows access to arbitrary nodes in the tree of program states.

Is that correct? If so, which kind of continuation is meant when people refer to "compiling with continuations"? Do they mean writing a compiler that supports a language with strong continuations? Or do they mean that using weak continuations is a useful way of structuring compilers? What other uses of continuations are there, and which kind of continuation is considered?

Ehud Lamm - Re: Continuations  blueArrow
4/4/2003; 5:41:31 AM (reads: 419, responses: 0)
Andrew, did you forget that as a contributing editor you can (and should!) post to the home page?

Ehud Lamm - Re: Continuations  blueArrow
4/4/2003; 5:46:37 AM (reads: 416, responses: 0)
The two meanings you describe are not that different if you realize that by changing the program to continutation-passing-style (something that can be done automatically by the CPS transformation), the function you call next does indeed "include the entire program state" -- understanding "include" to mean the state information that is in fact required is implicitly what governs the CPS transformation.

andrew cooke - Re: Continuations  blueArrow
4/4/2003; 9:38:29 AM (reads: 412, responses: 0)
Thanks. That's what I was looking for (couldn't find the phrase CPS). This whole topic suddenly makes a lot more sense. Didn't post to the front page because I thought it might be a duplicate - haven't been reading here for a year or so!