[racket] moby/wescheme & TCO

From: David Herman (dherman at ccs.neu.edu)
Date: Sun Jan 30 12:04:29 EST 2011

I don't have your answer, but an interesting anecdote: I learned recently why the setTimeout(k, 0) trick is so slow. Apparently too many web sites (including nytimes.com, I believe) rely on a minimum delay of somewhere between 4 and 10ms to do animations, so browsers have to throttle the events. As I understand it, Firefox uses a 10ms minimum delay, and Chrome uses 4ms.

Since Chrome seems to have gotten away with dropping it to 4ms, we may be able to do the same -- though I haven't heard anyone specifically say they planned to. Maybe at some point we can eliminate this silliness altogether, and setTimeout could become a more viable tool for compiler-writers. But happily, the ECMAScript committee recently agreed to try to mandate proper tail calls in the next version of the standard. So with a little (okay, maybe more than a little) luck, compiler-writers may eventually be able to rely on having tail calls built in to the web.

Dave

On Jan 29, 2011, at 9:12 PM, YC wrote:

> Hi all - 
> 
> I am wondering if there are documentations on how moby/wescheme solve the tail call optimization issue to compile down to javascript.  My google'fu is failing me. 
> 
> If not - can someone shed some light on how it's done?  
> 
> Thanks,
> yc
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users



Posted on the users mailing list.