[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: are we there yet?
Hi,
On 16 Apr 2002 14:56:06 -0400, Bruce Lewis <brlewis@alum.mit.edu> wrote:
> Dorai Sitaram <ds26@gte.com> writes:
>
> > Isn't anybody going to rage, rage against the
> > dying of the lightweight language list?
>
> I hereby warn this list that if I don't see some intelligent discussion
> about getting innovative language features into the hands of working
> programmers, I'm going to talk about BRL again next week. I mean it!
Christopher Oliver <coliver@mminternet.com> has done quite an
interesting job in adding continuations to the Rhino JavaScript
interpreter.
He started by initially implementing the call/cc equivalent, but
because of scoping issues in JavaScript, he decided to go with a
different approach.
He created a Continuation first class object, which when instantiated,
holds the continuation of the enclosing function. Using this approach,
call/cc could be implemented like this:
function callCC(func)
{
var k = new Continuation();
func(k);
}
He also modified Rhino to support (almost) proper tail call
optimizations, so the above implementation of call/cc will not eat any
space on the stack.
He's now working on implementing a facility similar with
dynamic-wind.
You can download his modified Rhino implementation from:
ftp://ftp/primaryinterface.com/pub/rhino/
Based on his work, I've started extending Apache Cocoon (an XML
oriented publishing framework) with continuations support, as
described in various papers by Christian Queinnec, and Paul Graunke et
al.:
http://youpou.lip6.fr/queinnec/Papers/webcont.ps.gz
http://www.cs.rice.edu/CS/PLT/Publications/esop2001-gkvf.ps.gz
You can take a look at this implementation on the Web at:
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/scratchpad/schecoon/
Regards,
--
Ovidiu Predescu <ovidiu@apache.org>
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)