Should Linux distributions ship Clojure byte compiled (AOT) or not?

Since you also summoned me…

I cannot understand the obsession Linux package manager folks have with trying to “package the world” from scratch. The JVM world simply doesn’t work like that – and there is a perfectly good (and well-trusted) repository of libraries already that avoids all this duplication.

I can see some benefit in a distro packaging the clojure / clj CLI so that it’s available via the distro package manager, but these things always seem to lag behind the official installer and that then leads to all sorts of confusion when people install the CLI via the package manager and then can’t get a lot of stuff to work because it’s an old version. For a while there was a rogue clojure package on at least one distro that was completely unrelated to the official CLI (and did not work at all the same way).

Packaging up the Clojure CLI also means that every package manager maintainer is a) duplicating work since there’s a perfectly good Posix installer script for the CLI already and b) setting themselves up for a lot of future maintenance tracking all the new versions of the CLI. You link to the Guix clj-tools package: that is almost 18 months out of date – see Clojure - Tools Releases for all the subsequent releases. Packaging old versions and not keeping them maintained is actively counter-productive and causes more problems for developers than it solves. Packaging those other libraries is even more counter-productive since that’s just not how they get used in the JVM world.

The question in the subject line doesn’t even really make sense. The Clojure core libraries on Maven are already AOT-compiled but pretty much all other Clojure libraries (even the Contrib stuff on Maven) are all source code by design. AOT-compiling Clojure libraries is an anti-pattern.

Even the core AOT-compiled library isn’t repeatable, I believe, which is something some of the package manager folks seem very concerned about. It’s a non-goal. The only reason people AOT stuff in Clojure is for improved startup speed so, aside from core itself, only applications tend to be AOT’d (not libraries).

3 Likes