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

Re: continuations and linear types



On Fri, 19 Apr 2002, James Knight wrote:

> However, every time I think about multi-callable continuations they seem
> like a worse idea. That message reminds me of my biggest objection: that
> functions can get put in normally-impossible states of execution. Even
> for web-applications it seems like a poor idea, as the state of the data
> is not copied, only the state of execution. The That's all well-and-good
> as long as you make sure not to ever modify program state or ever use
> non-functional operations in your app. If anything does, it could end up
> in serious trouble. That seems to me to be quite poor, and it makes me
> think that what you really want to have for web-applications is fork().

I use full continuations for commercial web development literally every
day and never run into "normally-impossible state" situations.  This is
likely for two reasons:

- the implementation of continuations I use (for Smalltalk, in Smalltalk)
has slightly strange semantics, in that it copies all of the bindings on
each invocation, so that assignments to locals in one invocation don't
affect any others.  This makes it much better suited to backtracking.

- the program state (that is, the state of the interaction with the user,
as opposed to the state of databases, etc) is kept in well defined places
such that copying and restoring it can be easily automated and controlled.

The first is a real language consideration (well, unless, as in Smalltalk,
you have a reified stack), and I would certainly recommend that a language
intended to be used for web development add this variant of call/cc to its
repertoire.  But then, I don't know if that's a goal of GOO.

The second is a fairly natural result of designing a structured framework
for web applications, and I would expect to be able to build something
similar in any language I was using.

Cheers,
Avi