clr 2026-11-17

Clojure.Cljr (AKA cljr) 0.1.0-beta3 is released

dotnet tool install -g Clojure.Cljr --version 0.1.0-beta3
This release has fixes a few things, such as improved staleness testing for updating the classpath (CLOJURE_LOAD_PATH for us.) Of perhaps greater significance, you can now specify the ClojureCLR version and the .NET framework to be used in running your program. ClojureCLR version specification On the JVM, it has been possible to control the version of Clojure used by specifying the Maven coordinates for Clojure(JVM) itself. From one deps.edn I picked at random (`core.cache`):
;; You can also specify an alias to select which version of Clojure to test
;; against: :1.9 :1.10 :1.11 :1.12

{:paths ["src/main/clojure"]
 :deps {org.clojure/data.priority-map {:mvn/version "1.2.1"}}
 :aliases {:1.9 {:override-deps {org.clojure/clojure {:mvn/version "1.9.0"}}}
           :1.10 {:override-deps {org.clojure/clojure {:mvn/version "1.10.3"}}}
... }}
There is no equivalent to this for the CLR. Up to now, cljr has been running your application using the version of the clojure.main tool installed on your system. Now you can specify the version in your deps-clr.edn or deps.edn file using the :clr/clojure-version key. This can occur at the top level of your deps file or it can be per alias. (Last alias wins.)
{:paths ["src/main/clojure"]
 :clr/clojure-version "1.12.3"
 :aliases {:clj-1.12 {:clr/clojure-version "1.12.6"}
           :clj-1.13 {:clr/clojure-version "1.13.0-alpha3"}}}
The first use of a version in any project downloads it into your nuget cache; later runs, in any project, invoke the downloaded version. Note that requesting a version does not change the version of clojure.main installed on your system. .NET framework specification Normally, cljr starts Clojure.Main using the .NET framework default for Clojure.Main, namely, . If you wish to run with additional frameworks, you can specify those with a :clr/frameworks entry. Here is an example deps.edn:
{:paths ["src"]
 :aliases {:web     {:clr/frameworks [""]} 
           :desktop {:clr/frameworks [""]}}}
Running cljr -M:web ... would add as a shared framework, allowing you to execute (assembly-load "Microsoft.AspNetCore"), for example. Combined aliases add up: cljr -M:web:desktop ... adds both frameworks. :clr/clojure-version and :clr/frameworks are CLR-only. JVM tools ignore unknown alias keys so they are safe in a shared deps.edn, or you can put them in deps-clr.edn. More information on these in the https://github.com/clojure/clr.core.cli/blob/main/README.md Supporting libraries for cljr were also updated: • io.github.clojure/clr.tools.deps.edn {:git/tag "v0.9.55" :git/sha "a1235c2"} • io.github.clojure/clr.tools.deps {:git/tag "v0.31.1647" :git/sha "0bca631"} • io.github.clojure/clr.tools.deps.cli {:git/tag "v0.31.162" :git/sha "4347e89" }

👍 3
🎉 7
🦄 1

> dotnet tool install -g Clojure.Cljr --version 0.1.0-beta3
Since you just installed the .NET SDK, you will need to logout or restart your session before running the tool you installed.
You can invoke the tool using the following command: cljr
Tool 'clojure.cljr' (version '0.1.0-beta3') was successfully installed.
How do I tell what version my cljr is?
> cljr -version
Execution error (FileNotFoundException) at (REPL:1).
Cannot find file to load: -version

Full report at:
/tmp/clojure-3954eeaf-3fa3-4222-ab64-c69be48e0db0.edn
> cljr --version
Execution error (FileNotFoundException) at (REPL:1).
Cannot find file to load: --version

Full report at:
/tmp/clojure-561d646e-7c4d-4bc8-a6f4-02abbb42b731.edn

Cleaned out my old install, ran that installer again, cljr gave me an error that clojure.main wasn’t installed, so I installed that, updated my deps-clr.edn, and it worked!!

> cat deps-clr.edn
{:paths ["src"]
 :clr/clojure-version "1.13.0-alpha8"
 :aliases
 {:runner
  {;:extra-paths ["test"]
   :extra-deps {io.github.dmiller/test-runner
                {:git/tag "v0.5.3clr" :git/sha "ae91dd2"}}
   :exec-fn cognitect.test-runner.api/test}}}
> cljr
Downloading ClojureCLR 1.13.0-alpha8...
Clojure 1.13.0-alpha8
user=>
Very nice!

My Q about cljr‘s version still stands tho’ 🙂

cljr --version

Ah, the version I had installed didn’t work with that. I suspect I’d tested in-1 to install cljr and it installs wrapper scripts and the script doesn’t work properly.

(I ran into problems with the bbin install from in-1 as well: it’s really good with simple executables but anything beyond that is… challenging, it seems)

There does need to be a clojure.main installed for some aspects of cljr itself to run. For exammple, the classpath calculation runs on the installed clojure.main