Hacker News new | ask | show | jobs
by jwr 399 days ago
> My surface level understanding is that GCL is a big reason why 3rd party libraries are a huge pain to use in Clojurescript.

This isn't true.

What you might have heard is that the Google Closure Compiler with :advanced optimizations makes external libraries harder to use. This also isn't true if you use good tooling (shadow-cljs makes using npm libraries transparent and totally painless).

It is worth observing that :advanced optimizations result in a significant speed increase, but are considered too difficult to use in the JavaScript world. ClojureScript was designed from the start to be compiled in :advanced mode, so you get the benefits of an impressive whole-program optimizing compiler for free.

1 comments

what kind of difficulties come up in practice in :advanced mode for JS? I would have assumed that by now code is pretty good about not using "weird" effects
Externs are the main user-facing hurdle, and there's plenty of JS that doesn't bother declaring its shape ahead of time or uses dynamic access patterns.