clr 2025-03-25

An update on reactivating AOT-compilation for ClojureCLR on .NET 9: It appears to be working. It can compile all the Clojure core course code. When started with the AOT-compiled core, the Clojure test suite is all green. Some stats. I put a stopwatch around the loading of the core code itself. This would not time startup of the CLR itself, nor the loading of some non-core Clojure code, such as main.clj. The things not timed would be relatively minor compared to the core load. Release build, Framework 4.8, core AOT-compiled: 702 msec Release build, .NET 9, core NOT AOT-compiled: 1975 msec Release build, .NET 9, core AOT-compiled: 370 msec Most of you probably don't run a Debug build, but I spend my life there. Debug build, .NET 9, core NOT AOT-compiled: 7105 msec Debug build, .NET 9, core AOT-compiled: 944 msec All timings from my somewhat middling desktop PC running Windows 11. While watching a video, memory at 75%. In other words, the way I code. 🙂 RIght now, the code is in a feature branch in the repo (named plan9, because of course). The plan going forward: Move the ClojureCLR 1.12.0 release from beta1 to final release. Do a little more analysis of generated code. There's at least one tweak I need to make that will make compiled code more robust to recompilation of base libraries. Do a little more testing. Modify the build process so that the .NET 9 ClojureCLR tooling is delivered with ILMerged AOT-compiled files. Do a little more testing. Release 1.12.1-alpha1 so the intrepid among you can kick the tires.

🚀 4
🎉 10

A quick update: I had to work on restoring some tests in the Clojure test suite that required AOT-compilation. Those tests revealed a few edge cases that needed some work. During that I found a tweak that accomplished two things: (1) automating loading of dependent assemblies from compiled code; and (2) a significant speedup in the Clojure core load. All tests now run. The build process can package the AOT-compiled DLLs with the tool that will get delivered. My proof:

>>>  clojure.main
Clojure core loaded in 2489 milliseconds.
Clojure 1.12.0-beta2
user=>
^C

>>>  clojure.main
Clojure core loaded in 225 milliseconds.
Clojure 1.12.0-beta2
user=> ^C
I do not know why the first invocation after installing the tool loads slowly. I had debug prints indicating that it was indeed loading the AOT-compiled files. I have no idea why. Subsequent invocations have the fast loading time that is expected. Note the decrease in core load time to 225 msec from the 370 msec reported earlier this week. https://www.youtube.com/watch?v=0QZdEdkTHW8 Expecting to have the final release of ClojureCLR 1.12.0 and the alpha release of 1.12.1 with AOT early next week.