I’m wanting to learn how to work on Clojure itself. I’ve got IntelliJ (without Cursive) set up to work with the java codebase but now I want to know how people work on the Compiler itself. I’m interested to hear experiences and resources about
general overview of how the compiler works
how to set up workflow to create artifacts and test them
how to get a repl running in the Clojure codebase so you can quickly interact
how to profile the results of changes
I’m reading lots of tickets in Jira and git commits but its still quite a lot. Just wondering what people here have done to get involved. Thanks.
Re workflow, there are instructions for build and test in several ways in the readme: https://github.com/clojure/clojure/blob/master/readme.txt (shocking I know :). Just mvn clean install is enough to build a deploy a snapshot version with your local changes that you can use from other projects.
You can use that jar in a repl with just clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-master-SNAPSHOT"}}}'. (Note that right now snapshot deps are only retrieved from Maven daily, so you’ll need to remove from ~/.m2/repository/org/clojure/clojure/… then add -Sforce to force a re-load (this is something I expect to fix in clj soon).)
Another option is to set up a deps.edn right in the clojure project itself (I do this for some stuff) that looks like this:
And then another another way to do it is to connect a Clojure repl via an IDE (I do this via Cursive). That’s useful because you can actually walk across both Java and Clojure code.
I typically use Criterium to profile changes with the bench or quick-bench functions.