Danny - thanks for the explanation on how it works and the links to the paper. I will look into them.
Appreciated! yc On Sun, Jan 30, 2011 at 12:11 PM, Danny Yoo <d...@cs.wpi.edu> wrote: > > Hi YC, > > The current runtime has an interpreter that's explicitly managing the > control stack, so it can do the tail-call optimization manually. > > > > An approach to get tail calls in JavaScript is described in > "Exceptional Continuations in JavaScript": > > http://www.schemeworkshop.org/2007/procPaper4.pdf > > where the restoration of the continuation skips tail frames (Section > 4.2 of that paper). So you could imagine saving and restoring the > continuation every so often, which will clear the control context of > tail call frames. > > > > SICP Chapter 5.5 has a compiler that does the tail-call optimization > in its generated intermediate code. I have a prototype that assembles > to JavaScript: > > https://github.com/dyoo/js-sicp-5-5/blob/master/cm.rkt > > Example: > > http://hashcollision.org/tmp/gauss.html > > The new version of the Moby compiler/runtime that I'm working on will > be based on this prototype. >
_________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users