It should be possible to analyze the tail recursive functions and transform them so the recursion becomes a loop in the CFG. This way we can keep the IR the same-old SSA.
- Maxime
It seems like tail-calls will become mandatory in the not too distant future.
What support do we have for tail-calls? I remember discussing this early on in the project, but I'm not sure that at this point in time the intermediate representation supports it.
Marc
Begin forwarded message:
From: David Herman dherman@ccs.neu.edu Date: January 30, 2011 12:04:29 PM EST To: YC yinso.chen@gmail.com Cc: Racket Users users@racket-lang.org Subject: Re: [racket] moby/wescheme & TCO
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
For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users
Tachyon-list mailing list Tachyon-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/tachyon-list