[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: So, what the heck is a continuation anyway?



Dan Sugalski wrote:

> Okay, so here's where I get to air my ignorance in public.
> 
> I've been working on the design of the Parrot VM and it's pretty well 
> nailed down. All the stuff I need done (good method dispatch, 
> attributes, coroutines, continuations, threads, I/O, GC, 
> language-independent calling conventions, higher-order functions) is at 
> least sketched out. Devil's in the details, of course, but at least 
> there are spots for the details to go. Someone's even started in on a 
> JIT for the thing. (x86 only for the moment, but...)
> 
> The final issue is continuations.
> 
> I'm not sure I need to support 'em. Perl, python, and ruby don't use 
> them to the best of my knowledge, and I've been told that Scheme doesn't 
> require them, but I'd like to build support in from the beginning, as I 
> expect it'll be rather a pain to add it in later. Unfortunately I don't 
> understand the things at all--I can't wrap my brain around any of the 
> explanations I've seen.
> 
> Could someone give me an explanation of them? (Preferably in words of 
> three syllables or less, geared towards an inveterate assembly language 
> programmer? :)
> 
>                     Dan
> 
> --------------------------------------"it's like this"-------------------
> Dan Sugalski                          even samurai
> dan@sidhe.org                         have teddy bears and even
>                                      teddy bears get drunk

They represent the "rest of the execution" at a certain point in the 
program including the local environment at the time the continuation was 
captured.

-- 
Jeffrey Palm --> http://www.cs.colorado.edu/~jdp