> We are working on restoring that original stability. With this release, you’ll find that quite a few old ClojureScript libraries work again today as well as they did 14 years ago.
> ClojureScript is and never was only just for rich web applications. Even in the post React-world, a large portion of the web is (sensibly) still using jQuery. If you need robust DOM manipulation, internationalization, date/time handling, color value manipulation, mathematics, programmatic animation, browser history management, accessibility support, graphics, and much more, all without committing to a framework and without bloating your final JavaScript artifact - ClojureScript is a one stop shop.
bbkane · 2h ago
From the outside (I haven't tried it), committing to ClojureScript for an application looks very similar to committing to a framework - it's a heavy influence in how you will write code.
actuallyalys · 1h ago
I daresay ClojureScript typically has a significant influence, but it's more social than technical. Many of the examples and tutorials are going to favor a certain style, and people who choose ClojureScript mostly do so because they like Clojure.
But if you want to do tons of JavaScript interop, you can. If you want to adopt some syntax, you can (through macros). If you want to use jQuery directly, you can. If you want to use a React wrapper, you can. There's not really technical limits pushing you toward a style or architecture, although you still have the underlying limits of JavaScript and the runtime environment.
swannodette · 1h ago
I'm curious as to how you think this is different from say, committing to JavaScript/BundlerX/NPM or TypeScript/BundlerX/NPM? Surely those have an equally heavy influence on how you write code?
lukev · 4h ago
One of my favorite things about the JVM ecosystem is how stable it is. A 5-year-old library will almost certainly Just Work. And Clojure very much follows the same spirit. There's a lot of great, useful libraries that haven't been updated in years... not because they've been abandoned but because they're _done_ and just don't require active maintenance.
Immutability as a cultural value, not just a data structure.
> If you want a rich text editor that truly is Gmail's compose editor as it has existed for the past decade - that emits the same structures that Gmail would, handles copy-pasted rich text the same way Gmail does, has the same behavior in typing inside links etc... which is especially useful if you're building an email client that Gmail users need to feel familiar on every keystroke... then following https://github.com/google/closure-library/blob/master/closur... line-for-line is still the gold standard, because it grew from the same codebase as Gmail.
> I've had great success at a previous startup referencing a prebuilt Closure Library from a modern ES6+ codebase and creating a React-friendly wrapper around the editor component, and using this to power an email templating experience. Ironically, I'm within weeks of needing to do it again, thanks to Zawinski's Law https://en.wikipedia.org/wiki/Jamie_Zawinski#Zawinski's_Law - "Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can." I'll give you one guess what I'll be reaching for, archived or not.
> Others have more context on the history and have written more detailed obituaries - but it's a true testament to the engineers that worked on it, that a library can be so ahead of its time that it's still an industry-leading experience [15] years after its initial release.
I'm happy to see that it's being maintained! (And that project where I was planning to use it again got delayed, but it might be on deck soon!)
spinningarrow · 2h ago
Is it being maintained? From the README:
> Closure Library has been archived. We no longer see it as meeting the needs of modern JavaScript development, and we recommend that users look for alternative solutions.
Edit: ah I see that the Clojure folks are going to take that up. I missed that!
john2x · 3h ago
While the level of commitment to backwards compatibility is commendable, I had hoped this would trigger dropping GCL instead of forking it.
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.
Volundr · 3h ago
At this point dropping GCL would be a breaking change. Many, many libraries rely on it.
> 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.
amgreg · 3h ago
I think you are conflating the Closure Library with the Closure Compiler. They are related but not identical. The Compiler, I think, is what makes it difficult to use externs; its “advanced optimizations” can and often does break libraries that weren’t written with the Compiler’s quirks in mind. But advanced optimizations is an option; if you don’t need aggressive minification, function body inlining, etc. you can opt out.
Shadow CLJS has made working with external libraries quite easy and IIRC it lets you set the compilation options for your libraries declaratively.
john2x · 3h ago
Ahh right. Yes I am in fact conflating the two.
But can the compiler be used without the library? Or can the library be used without the compiler/would it still be beneficial?
amgreg · 2h ago
Yes and yes; in the past, prior to ECMAScript providing first-class inheritance, module ex/imports etc, the Library supplied methods to achieve these in development, and the Compiler would identify these cases and perform the appropriate prototype chaining, bundling, etc. See, eg, goog.provide
For the most part, I would guess people still use the Closure Compiler because of its aggressive minification or for legacy reasons. I think both are probably true for ClojureScript, as well as the fact that the Compiler is Java-based so it has a Java API that (I am guessing here) made it easier to bootstrap on top of the JVM Clojure tooling / prior art.
paulddraper · 3h ago
EDIT: HN title said Compiler, article says Library.
moomin · 3h ago
They’ve forked the library, not the compiler. The Java version thing they’ve taken the hit on. (The HN title is incorrect.)
Borkdude · 3h ago
Updated the title
Borkdude · 3h ago
This is not about maintaining compatibility with a Java version. As you can read in the post, Java 21 will be the minimum required Java version even. It's about the Google Closure Library on which many ClojureScript programs depend.
Borkdude · 3h ago
The title didn't say compiler, it just said "Google Closure". The article I linked to is very clear that it's about the library.
> ClojureScript is and never was only just for rich web applications. Even in the post React-world, a large portion of the web is (sensibly) still using jQuery. If you need robust DOM manipulation, internationalization, date/time handling, color value manipulation, mathematics, programmatic animation, browser history management, accessibility support, graphics, and much more, all without committing to a framework and without bloating your final JavaScript artifact - ClojureScript is a one stop shop.
But if you want to do tons of JavaScript interop, you can. If you want to adopt some syntax, you can (through macros). If you want to use jQuery directly, you can. If you want to use a React wrapper, you can. There's not really technical limits pushing you toward a style or architecture, although you still have the underlying limits of JavaScript and the runtime environment.
Immutability as a cultural value, not just a data structure.
> If you want a rich text editor that truly is Gmail's compose editor as it has existed for the past decade - that emits the same structures that Gmail would, handles copy-pasted rich text the same way Gmail does, has the same behavior in typing inside links etc... which is especially useful if you're building an email client that Gmail users need to feel familiar on every keystroke... then following https://github.com/google/closure-library/blob/master/closur... line-for-line is still the gold standard, because it grew from the same codebase as Gmail.
> I've had great success at a previous startup referencing a prebuilt Closure Library from a modern ES6+ codebase and creating a React-friendly wrapper around the editor component, and using this to power an email templating experience. Ironically, I'm within weeks of needing to do it again, thanks to Zawinski's Law https://en.wikipedia.org/wiki/Jamie_Zawinski#Zawinski's_Law - "Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can." I'll give you one guess what I'll be reaching for, archived or not.
> Others have more context on the history and have written more detailed obituaries - but it's a true testament to the engineers that worked on it, that a library can be so ahead of its time that it's still an industry-leading experience [15] years after its initial release.
I'm happy to see that it's being maintained! (And that project where I was planning to use it again got delayed, but it might be on deck soon!)
> Closure Library has been archived. We no longer see it as meeting the needs of modern JavaScript development, and we recommend that users look for alternative solutions.
Edit: ah I see that the Clojure folks are going to take that up. I missed that!
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.
> 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.
Shadow CLJS has made working with external libraries quite easy and IIRC it lets you set the compilation options for your libraries declaratively.
But can the compiler be used without the library? Or can the library be used without the compiler/would it still be beneficial?
For the most part, I would guess people still use the Closure Compiler because of its aggressive minification or for legacy reasons. I think both are probably true for ClojureScript, as well as the fact that the Compiler is Java-based so it has a Java API that (I am guessing here) made it easier to bootstrap on top of the JVM Clojure tooling / prior art.