[gambit-list] JavaScriptScheme: too much recursion

Marc Feeley feeley at iro.umontreal.ca
Sat May 31 09:09:04 EDT 2008

JSS uses CPS conversion and trampolines, so the call graph is (should  
be?) of a small constant depth.  I don't know why you are getting a  
"too much recursion error".  The only thing I can think of is that the  
JavaScript code itself is too heavily nested (syntactically) and the  
JavaScript interpreter/compiler overflows the compile-time stack while  
parsing/compiling the code.  Does the problem occur for large files  
only?  Have you tried JSS on other browsers?  I'm curious which ones  
encounter the same problem.  Do you have a test case I can try?


On 30-May-08, at 3:51 PM, James Long wrote:

> Hey Marc (or anyone who has used Jss from the Dumping Grounds on the
> wiki),
> I grabbed your scheme-to-javascript compiler off the dumping grounds,
> and it works great in Safari.  In Firefox 2 & 3 however, the
> javascript engine throws the error "too much recursion."  I will be
> looking through the code myself, but do you think there's a fix?  If
> it's a real stack overflow error (not from an infinite loop), you
> could do some optimizing before spitting out the Javascript.  This
> might get too involved, and the compiler might not have all the
> information to make guesses at inlining, etc.  I haven't studied CPS-
> transforming compilers enough yet.
> - James
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list

More information about the Gambit-list mailing list