(no title)
john2x | 9 months ago
My surface level understanding is that GCL is a big reason why 3rd party libraries are a huge pain to use in Clojurescript.
Of course this would have went completely against the project’s goals, so it was never going to happen.
amgreg|9 months ago
Shadow CLJS has made working with external libraries quite easy and IIRC it lets you set the compilation options for your libraries declaratively.
john2x|9 months ago
But can the compiler be used without the library? Or can the library be used without the compiler/would it still be beneficial?
Volundr|9 months ago
> My surface level understanding is that GCL is a big reason why 3rd party libraries are a huge pain to use in Clojurescript.
I'm sure what "huge pain" your referring to, but I'm guessing it's dealing with name munging when externs aren't readily available. That comes from the compiler, not the library, and can be annoying. Mainly you have to make sure you reference things in ways that won't get mangled by the compiler (get x "foo") instead of (get x :foo). If you want to escape that you can always turn of advanced optimizations.
jwr|9 months ago
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.
rtpg|9 months ago