I can vouch for that. I’ve been using Gambit in real life applications for 20 years and I’ve never encountered a GC bug
Great thank you.
@belmarca I can't speak with any confidence about performance. But my little Game of Life simulation built on u8vector has been pretty nice. It has about ~50 life ticks/s and allocates ~56MB/s with collection times between 100us and 150us. With a constant 83K live heap. By no means is it stressing the GC as much as other things -- but thus far I have found it to outperform Chez Scheme for the same program. I'm by no means an expert on either implementation, so take this with a grain of salt. :)
Although I believe the GC currently stops all threads during collection? For my little programs, this isn't a problem (I'm using green threads) -- I'm not sure how this compares to Go's collector
@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.