[racket] moby/wescheme & TCO

From: YC (yinso.chen at gmail.com)
Date: Mon Jan 31 03:14:21 EST 2011

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 <dyoo at 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110131/fd43419e/attachment.html>

Posted on the users mailing list.