Jason, Sylvain, Antti, Stefano, I looked on the Rhino code, and also spoke with Christopher Oliver (Rhino serialization) and Norris Boyd (Rhino main developer) about continuations support in Rhino.
Unfortunately proper tail recursion, which is one of the key requirements for good continuations support, is not supported by Rhino. Proper tail recursion refers to the ability of tail recursive functions to execute in constant space, e.g. no values are used on the stack to invoke tail recursive functions. Tail recursion is a very used technique in functional languages and is crucial in implementing continuation passing style programs. By looking at the Rhino code, it appears to me to be a lot of work to modify it to have such support. Since I'm not familiar with that code, and because so many things have to changed, I believe the safest thing for us is to continue working on the language we defined for our needs. The ideas are quite clear on what we want to do, and the implementation should not be too complicated. Greetings, Ovidiu On Wed, 06 Mar 2002 14:28:55 -0500, Norris Boyd <[EMAIL PROTECTED]> wrote: > The Rhino interpreter does NOT implement tail recursion in constant > space. One problem with attempting to implement that transformation is > that there is a Function interface that all calls use. Any tail > recursion optimization would have to violate that abstraction. The > Function interface is implemented by a variety of different ways to > evaluate code: interpreted JavaScript, JavaScript compiled to Java > bytecodes, Java methods exposed through reflection, and JavaScript > built-in functions implemented in Java. On Wed, 06 Mar 2002 12:57:25 +0100, Stefano Mazzocchi <[EMAIL PROTECTED]> wrote: > Antti Koivunen wrote: > > > > Ovidiu Predescu wrote: > > > Hi Jason, > > > > > > Thank you for the pointer, I've downloaded Oliver's code and I'm > > > playing with it right now. > > > > > > By looking at the code it appears easy to extend the code to add full > > > continuations support in Rhino. I'll investigate some more and come > > > back with more thoughts and ideas on it. > > > > > > If continuations are added in Rhino, I think I'll go down this path, > > > instead of using Scheme, as it makes things much easier to implement > > > and, as Sylvain pointed out, be accepted by users. > > > > No objections here if it provides what we need. I'm sure everybody > > understands the benefits of using a popular scripting language and a > > well tested implementation like Rhino. > > I absolutely agree! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]