Podcast that inspired comparison of CLJS to Scala.js/Slinky

ClosureScript preceded Scala.js by a year or so, IIRC. There hasn’t been much direct inspiration–in fact major technical decisions are diametrically opposed between the two systems–but it’s always been good to check up on what works better on the other side, so that we know what we could do better. Live reloading is a major example where we’re jealous of CLJS, and where I’d like us to do better.

We use Closure mostly for its advanced minification of symbols across the codebase and JavaScript-specific optimizations for size. Prior to giving code to Closure, we apply our own dead code elimination and optimizations, which take advantage of the static types. Our dead code elimination, per se, is better than Closure’s, because of the reliable types. We can also do advanced optimizations like closure elimination and a form of stack allocation. One example I recall impressed David Nolan was the performance of our 64-bit integers (Longs), which we can achieve because of those optimizations.

2 Likes