@amirouche thanks. does this build a library _gambit.js inside gambits source tree?
@bentxt yes it builds lib/_gambit.js which is most of the normal Gambit Scheme library
@amirouche I've looked at your JS performance experiment... what is the Scheme code that you are compiling? factorial wouldn't be my first choice of benchmark because very soon you need bignums to compute factorials of > 20 or so
I typically use fib which exercices function calls and fixnum arithmetic and it is very easy to scale to a larger time by incrementing the argument
when you say "almost as fast as JS" do you mean compared to factorial written directly in JS or through your compiler?
I sometimes ask candidates if they know of an O(1) way to implement factorial. Only one or two have actually come up with the answer.
@johnwcowan using a memo?
@feeley it is a tail recursive factorial
Using a precomputed array of all possible factorials that can be represented as 64-bit floats.
@feeley@amirouche ok that is producing a 21M large _gambit.js file, I guess I'll try other solutions then, ... thanks anyway
@bentxt As was mentioned before, if your application is small (you need reverse and just a few other things), then you should build your own runtime library and you will get a reasonable JS code size, especially if you minify the code. See the mentioned link.