= Clojure Deref (Oct 27, 2023)
Alex Miller
2023-10-27
:jbake-type: post

ifdef::env-github,env-browser[:outfilesuffix: .adoc]

Welcome to the Clojure Deref! This is a weekly link/news roundup for the Clojure ecosystem (feed: https://clojure.org/feed.xml[RSS]). Thanks to Anton Fonarev for link aggregation.

== From the core

Last week we released https://clojure.org/news/2023/10/20/clojure-1-12-alpha5[Clojure 1.12.0-alpha5] with a change in `lazy-seq` and `delay` to avoid virtual thread pinning in Java 21. Even if you are not using Java 21, this change may affect latency, allocation, or GC. If you are able to test it in the context of an application with known performance profile, we would be very interested in any feedback even if it's just "no change".

I've previously mentioned adding support for a new type hint syntax for array classes (https://clojure.atlassian.net/browse/CLJ-2807[CLJ-2807]). We've decided to expand that to a value syntax for array classes as well so that just as you can use a symbol with class name now to get the class value, you will be able to do the same with array classes. That decision led to some deeper thinking about how that new usage may potentially conflict with symbol namespace mappings (particularly for the primitive array cases) due to the common idiom of using a suffixed `pass:[*]` to indicate a variant or internal version of a function. I'm not sure we are 100% settled yet, but I think we're going to slightly alter the syntax to make name clashes less likely. Array class symbols will now use the syntax `pass:[String-*]` and primitives will look like `pass:[long-*]`. This will be the same in either type hints or in value syntax.

Method thunk work has been broken up into a series of smaller tickets (https://clojure.atlassian.net/browse/CLJ-2805[CLJ-2805], https://clojure.atlassian.net/browse/CLJ-2806[CLJ-2806], https://clojure.atlassian.net/browse/CLJ-2793[CLJ-2793]) and been through a couple review cycles, continues to march toward final screening. I don't think there are any open questions there, just a matter of review and code improvement.

I've been working through various final parts of the functional interface adapter work. The biggest recent change is to focus on using a set of static adapter functions (created once via a code generator) rather than emitting static synthetic adapter methods in compiled functions. In either case we're using invokedynamic so the adapter methods can cosplay as Java functional interfaces. Moving to static adapters lets us also easily handle adapting Clojure primitive functions so that those can line up and stay primitive when adapting to functional interfaces that use primitives. There are also dimensions of work to handle eval vs compile variants, and to handle Clojure function adapters vs method thunk adapters (where the previous work crosses into this one).

There is a lot of syntax and compiler novelty in these features, which is why they are are taking so long to finish, but the extra thinking time is paying a lot of dividends and I continue to be as excited about the changes in this release as any Clojure release in a long time. We are going to deliver a lot of new capability, but in a way that I think will feel highly integrated with the Java interop you've used for years.

== Podcasts and videos

* https://soundcloud.com/defn-771544745/92-defnno-with-magnar-sveen-and-christian-johansen[#92 defn.no with Magnar Sveen and Christian Johansen] - defn
* https://clojuredesign.club/episode/096-gaming-data/[Ep 096: Gaming Data] - Functional Design in Clojure
* https://www.youtube.com/watch?v=NO9D3LSS4WU[Portal Internals (by Chris Badahdah)] - London Clojurians
* https://www.youtube.com/watch?v=FjdXjwcXaZg[The Polylith Real World Example, with an IDE Running in The Browser] - Peter Strömberg
* https://www.youtube.com/watch?v=8uGj5DobMs8[Parens of the Dead - Episode 28: "wow"] - emacsrocks

== Blogs, articles, and projects

* https://jpmonettas.github.io/my-blog/public/compilers-with-flow-storm.html[Debugging Compilers] - Juan Monetta
* https://blog.tvaisanen.com/clojure-and-cross-origin-resource-sharing-cors[Clojure and Cross Origin Resource Sharing (CORS)] - Toni Väisänen
* https://tonsky.me/blog/simple-router/[New Library: Simple Router] - Nikita Prokopov
* https://www.juxt.pro/blog/designing-3d-printable-objects-with-clojure/[Designing 3D Printable Objects with Clojure and OpenSCAD] - Dajana Herichova (JUXT)

== Libraries and Tools

New releases and tools this week:

* https://github.com/clojure-emacs/cider[cider] https://github.com/clojure-emacs/cider/releases/tag/v1.9.0[1.9.0] - The Clojure Interactive Development Environment that Rocks for Emacs
* https://github.com/liquidz/build.edn[build.edn] https://github.com/liquidz/build.edn/blob/main/CHANGELOG.adoc[0.11.241] - Make your Clojure library build process easy
* https://github.com/fabiodomingues/clj-depend[clj-depend] https://github.com/fabiodomingues/clj-depend/blob/main/CHANGELOG.md[0.9.2] - A Clojure namespace dependency analyzer
* https://github.com/hoplon/hoplon[hoplon] https://github.com/hoplon/hoplon/blob/master/CHANGELOG.md[7.3.4] - Hoplon web development tools and libraries
* https://github.com/cjohansen/fontawesome-clj[fontawesome-clj] 2023.10.26 - FontAwesome icons as hiccup for Clojure(Script)
* https://github.com/BetterThanTomorrow/calva[calva] https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.392[2.0.392] - Clojure & ClojureScript Interactive Programming for VS Code
* https://github.com/squint-cljs/squint[squint] https://github.com/squint-cljs/squint/blob/main/CHANGELOG.md#0335-2023-10-25[0.3.35] - ClojureScript syntax to JavaScript compiler
* https://github.com/abogoyavlensky/automigrate[automigrate] https://github.com/abogoyavlensky/automigrate/blob/master/CHANGELOG.md#013---2023-10-26[0.1.3] - Database auto-migration tool for Clojure
* https://github.com/tonsky/toml-clj[toml-clj] 0.1.0 - Fast TOML parser for Clojure
* https://github.com/tonsky/clj-simple-router[clj-simple-router] 0.1.0 - Simple order-independent Ring router