Clojure
Clojure Deref (Apr 1, 2022)

Clojure Deref (Apr 1, 2022)

01 April 2022
Alex Miller

Welcome to the Clojure Deref! This is a weekly link/news roundup for the Clojure ecosystem. (@ClojureDeref RSS)

From the core

This week we’ve been tracking feedback from the 1.11 release and starting to scope out 1.12 work.

One thing that has bitten a couple people is that the Java serialization of Keyword changed in 1.11.0. This was an unintended effect and we expect to be rolling out a 1.11.1 shortly that addresses that (also fixes ArraySeq serialization which changed inadvertently as well). To explain more, Java serialization writes objects to a stream based on a class identifier (the serialVersionUID) and its private fields. By default, the class identifier is computed based on the public signatures and fields of a class and its parents. Due to internal changes in some bug fixes on Keyword, that signature changed in 1.11. Java has a feature that allows you to "pin" the serialVersionUID so that it is no longer computed - this is a good and recommended thing to do when classes are stable as it makes the serialization of these classes binary compatible even if the class changes in ways that don’t affect serialization. Going way back, Clojure classes were made serializable with helpful patches in the very early days of Clojure, but unfortunately the serialVersionUIDs were never pinned. I reviewed all of the old versions and Clojure has changed these ids frequently for many classes in many releases. We intend in Clojure 1.12 to pin all of these and at least minimize the unintended drift of these ids in the future.

Additionally, we’ve seen a couple reports from using AOT-compiled code from a prior release with a newer runtime where the compiled code used a function that is new (in particular abs in 1.11, but could be any new function that overlaps earlier compiled code). This is not an issue when source is loaded (you’ll get a warning and you can use refer-clojure :exclude to address that warning), but only on previously compiled code. Our intent here is that new functions added to clojure.core (which is auto-referred by default) should never break existing code, so this is definitely something we intend to fix in 1.12 as well. Recompiling with 1.11 (and using refer-clojure :exclude) is sufficient to address the problem.

Interestingly, neither of these are "new" problems with 1.11 (they have both existed for most of Clojure’s life) yet this is the first time we’ve seen them reported to my memory. Various changes in 1.11 made us more likely to see each of them and I’m thankful that people have been rapidly adopting the new release and giving us this feedback in problem reports. So thanks!

Libraries and Tools

New releases and tools this week:

  • brew-install 1.11.0.1100 - Clojure CLI

  • lein-git-revisions 1.0.0 - Automatically control, modify and adjust Leiningen project version based on metadata

  • tryit - Create cli snippets for quickly trying clojure libraries

  • dad 1.0.0 - Small configuration management tool for Clojure

  • mindra-clj 0.0.1 - A 2D Graphics library for clojure using diagrams and gloss

  • 4ever-clojure - Pure cljs version of 4clojure, meant to run forever!

  • clojure-lsp 2022.03.31-14.21.14 - Language Server Protocol for Clojure

  • Calva 2.0.261 - Calva is an integrated, REPL powered, development environment for enjoyable and productive Clojure and ClojureScript programming in Visual Studio Code

  • clj-test-containers 0.6.0 - Control Docker containers from your test lifecycle for Clojure integration tests

  • clj-konmari - The Life‑Changing Magic of Tidying Up Clojure Codebases

  • kekkonen 0.5.2 - A remote (CQRS) API library for Clojure

  • coax 1.0.0-alpha19 - Clojure.spec coercion library for clj(s)

  • polylith 0.2.14-alpha - A tool used to develop Polylith based architectures in Clojure

  • robot 0.2 - Clojure wrapper to simplify writing desktop scripts with java.awt Robot and Clipboard

  • dewey - Index of Clojure libraries available on github

  • yoltq 0.2.55 - An opinionated Datomic queue for building (more) reliable systems

  • nvd-clojure 2.4.0 - National Vulnerability Database dependency checker for Clojure projects

  • clj-test-containers 0.6.0 - Control Docker containers from your test lifecycle for Clojure integration tests

  • fastmath 2.1.8 - Fast primitive based math library

  • clojure2d 1.4.4 - Java2D wrapper + creative coding supporting functions (based on Processing and openFrameworks)

  • datalevin 0.6.4 - A simple, fast and versatile Datalog database

  • viscous 1.2 - pprint that respects your space and time

  • deps.clj 0.1.1100 - A faithful port of the clojure CLI bash script to Clojure