September 5th, 2024

Clojure 1.12.0 is now available

Clojure 1.12.0 introduces significant updates, including the last support for Java 8 bytecode, enhanced lazy-seq handling, new library management functions, and security fixes, preparing for future Java compatibility.

Read original articleLink Icon
ExcitementCuriositySatisfaction
Clojure 1.12.0 is now available

Clojure 1.12.0 has been released, marking significant updates and changes. This version maintains compatibility with Java 8 bytecode, but it is noted as the last release to do so, with future versions expected to transition to a newer Java LTS release. A key enhancement in this release is the adjustment of lazy-seqs and delays to use locks instead of synchronized blocks, addressing issues with virtual thread pinning in JDK 21. Security improvements include a fix for CVE-2024-22871, and updates to Java serialization identifiers for better compatibility. New features have been introduced to facilitate interactive library management, allowing users to add libraries without restarting the JVM. Functions such as `add-lib`, `add-libs`, and `sync-deps` enable dynamic library addition during development. Additionally, the Clojure CLI now supports invoking tool functions out of process, enhancing the development experience. The release also includes updates to dependencies, specifically for `spec.alpha` and `core.specs.alpha`. Overall, Clojure 1.12.0 aims to improve usability and maintain security while preparing for future compatibility with newer Java versions.

- Clojure 1.12.0 is the last version to support Java 8 bytecode.

- Enhancements include using locks for lazy-seqs and delays to avoid thread pinning issues in JDK 21.

- New functions allow interactive library management without restarting the JVM.

- Security updates include a fix for a critical vulnerability (CVE-2024-22871).

- Dependency updates were made for `spec.alpha` and `core.specs.alpha`.

AI: What people are saying
The comments on the Clojure 1.12.0 release reflect excitement and discussion about its new features and implications for developers.
  • Many users appreciate the new library management functions like add-libs and sync-deps, which simplify sharing code and demos.
  • There is a strong focus on the functional interface changes, which enhance interoperability with Java.
  • Some users express concerns about the pace of updates and the potential for complexity in future releases.
  • Several comments highlight the ongoing relevance of Clojure in the programming landscape, with users sharing their experiences and challenges.
  • Questions arise about the future of spec and its integration within Clojure, indicating a desire for more clarity on this topic.
Link Icon 17 comments
By @contrarian1234 - 7 months
This is really a massive release with many cool new features

My personal favorite is add-libs

You can now write single file demos or minimal examples for issues. Really lowers the friction to share small runnable snippets with people

You can also actually use it to demo Java libraries as well without all the Java boilerplate. Just poke around in the REPL and paste code into a comment on HN or wherever and anyone can replicate your "setup" and get it running exactly the same. No need to clone a repo or anything

By @koito17 - 7 months
I thought they were going to hold this until Clojure/conj 2024. No particular reason to believe so (besides Clojure 1.10 being released around the same time as Clojure/conj 2021 and the Datomic-becoming-free announcement being done at the very start of Clojure/conj 2023).

Still waiting on spec2, though... for now I am working around rigidity of specs by using Malli but it really isn't a first-class citizen in Clojure (mostly due to inability to check macros, and this is by design of the Clojure compiler). But you can emulate the ideas of schema/select by manipulating malli schemas as data.

The changes for functional interfaces also means we no longer have to maintain utility macros like

  (defmacro ->Consumer [f]
    `(reify java.util.function.Consumer
       (accept [this arg#]
         (~f arg#))))
and instead just pass functions directly.
By @jdminhbg - 7 months
Such a pleasure to get a boatload of new features and all my code just runs on it because of the hard work dedicated to avoid breaking changes.
By @puredanger - 7 months
If you're interested in learning more about Clojure, check out the Clojure/conj conference Oct 23-25 in Alexandria, VA. https://2024.clojure-conj.org :)
By @diggan - 7 months
Lovely to see add-libs and sync-deps, aren't many (any?) reasons to close down a session at all now.

This release feels like it had a very different scope from previous releases, contains a lot of stuff, which is exciting to see! But I hope it doesn't end up like a hairball a few releases down from increase of pace or something.

By @charlotte-fyi - 7 months
The functional interface changes are huge. Clojure is always at its best when staying close to Java via judicious use of interop and this solves one of the major missing links.
By @ledgerdev - 7 months
What had become of spec? Abandoned? Any news on hopes for it?
By @tgerdin - 7 months
Looks like a pretty solid release, very happy that Clojure is still going strong!
By @erichocean - 7 months
It's never been easier to turning existing developers into Clojure developers.

A major problem people have at first[0] is just reading the code. AIs like ChatGPT and Claude are incredibly good at explaining existing Clojure code.

As a result, developers can onboard much, much faster.

[0] After a few weeks, reading Clojure becomes second nature and you'll forget you ever COULDN'T read it.

By @pjmlp - 7 months
Lots of cool improvements. The main Lisp like language I usually reach for.
By @xxmarkuski - 7 months
Clojure is great. Brining together Lisp with the Java ecosystem makeand its concurrency model makes it great for building backend system, while still enabling quick changes. One thing that I found noteworthy is that Clujure did not pickup some innovations happening at Java since like version 8, such as Invoke Dynamic in the JVM or streams.
By @wiz21c - 7 months
Dumb question: what is clojure usually used for ? (in my view, Java is for "enterprise" stuff, python for AI/data sciences, C for performance, etc.)
By @kunley - 7 months
sync-deps and add-lib seems very cool
By @MarkMarine - 7 months
This is a wonderful language I've only just started paying attention to, watching the talks from Rich on YouTube have ruined things I loved (like Either types.) I'm struggling with how to introduce it into my company without recommending my colleagues follow my path of working through 3 books and then watching most of the conj talks from the last 12 years on 1.75x speed, while building a personal project and re-implementing a couple of services I work with every day in it... but the lessons around simplicity I think are so critical, I'm going to find a way.
By @minikomi - 7 months
Fantastic. Sure would love to get a clojure job one day.
By @anothername12 - 7 months
We had to dump a Clojure code base for Golang because it was too slow for lambda usage. Does any of this release help with startup time?