A short history of ReScript (BuckleScript)

Running JSOO emitted javascript on v8 and mozjs can be amazingly fast in some cases. Some time ago I did a little test program solving prime numbers, using a very simple algorithm (dividing by ascending odd numbers up to the root of the tested number) and it could solve the 100,000th prime under JSOO running in the browser faster (0.29 secs for v8, 0.26 secs for mozjs) than the equivalent code running in native ocaml (0.52 secs). I guess the test case happened to hit a sweet spot for v8’s and mozjs’s JITing of the loops into optimized CPU instructions. Normally JSOO is somewhat slower than native code. (For anyone interested in the comparison, it is here: http://www.cvine.plus.com/primes.tar.xz )

4 Likes