Google-Apps
Hauptmenü

Post a Comment On: Kaffee und: [Kuchen]

"Seaside 3: Partial Continuations"

13 Comments -

1 – 13 of 13
Anonymous Anonymous said...

This is very interesting. It really explains the internal workings of Seaside.
This week I began to study all the code of Seaside and this post helped me to understand the code inside it.
The explanation was very clear also. Very good post.
BTW, I found a typo in the text of the first image (continuations-example.png): in the last column the label should be "#foo returns" instead of "#bar returns".

Cheers,
Miguel Cobá

February 11, 2009 1:55 am

Blogger Julian Fitzell said...

Thanks, I've fixed that image. Good catch!

February 11, 2009 8:22 am

Anonymous Anonymous said...

Great post, very insightful! Keep it up!

February 11, 2009 9:04 am

Anonymous Anonymous said...

It looks like the naive scheme does not work because the request data (including the socket) is stored using some kind of dynamic binding. Would the naive scheme work if you were using per-process variables for that data?

February 11, 2009 10:46 am

Blogger Harold Fowler said...

Wow, fascinating stuff. Always wondered how that worked!

RT
www.anon-tools.us.tc

February 11, 2009 1:44 pm

Anonymous Anonymous said...

I used to be a homeless rodeo clown but now I am a world class magician !

February 11, 2009 3:12 pm

Anonymous Anonymous said...

What you are calling "Partial continuations" are known elsewhere (e.g. Scheme) as "Delimited Continuations". But thanks for given a great example of what benefit of them (I didn't have any use cases in mind before this entry).

February 11, 2009 5:18 pm

Blogger Mariano Montone said...

Very interesting! I wish you explained briefly how partial continuations are implemented in Smalltalk (or in Squeak if you want) and its api.

February 12, 2009 1:40 am

Anonymous Anonymous said...

I'd also like to know if the guys who implemented the "partial continuations" looked into how delimited continuations are implemented elsewhere. Perhaps the implementation could benefit from such a comparison. The technique you described of "graphing receivers" doesn't sound very nice. :)

February 12, 2009 7:44 am

Blogger Julian Fitzell said...

@Paolo Process variables do help and the first two releases of Seaside 2.9 were using a process variable to hold the current RequestContext for exactly this reason. But it's not that simple: the saved method contexts could have all kinds of local variables that might not have the same values when handling the two requests. You'd have to go through and make them all process variables I guess and even then you're assuming that the exact same path was followed through the code in the two cases. Not very practical.

@Anonymous They can be called partial continuation, delimited continuations, or composable continuations, yes. I don't know which implementations Lukas looked at previously but the one we are using in Squeak is quite straightforward and fairly specific, so far, to the way we use it in Seaside.

@Mariano Simplified, the implementation we use on Squeak and VW is to write the contexts and their local variable values and stacks to a stream.
When evaluating the continuation, we simply read the stream, restoring the contexts with the saved values. Then we take the context we want to eventually return into and set it as the sender of the bottom context in the continuation. Finally, we change "thisContext sender" to point to the top context in the continuation and then we return.
The implementation is quite straightforward and you can find it in the Seaside-Squeak-Continuations package in the Seaside29 repository on SqueakSource. There is also a unit test package.
GemStone is implementing their partial continuation support at the VM level.

February 14, 2009 9:32 pm

Blogger Johannes said...

Very interesting and insightful blog post, it helped me understand Seaside a lot better!

Thank you for the blog post and the link you gave me, it's much appreciated.

April 10, 2009 7:17 am

Blogger KanjiRecog said...

I am unable to get a 2.9 Seaside to load into VW nc7.6

So you have some advice? Thanks

August 01, 2009 8:46 pm

Blogger Julian Fitzell said...

Afraid not - the 2.9 VW port is pretty recent, though my understanding is that it should be working. Posting to the Seaside mailing list should get the attention of the VW developers.

August 03, 2009 12:54 am

You can use some HTML tags, such as <b>, <i>, <a>

You will be asked to sign in after submitting your comment.
Please prove you're not a robot