Skip to content

Yizhe's Notebook

Fast Starting JVM Clojure with Checkpoint/Restore (Part 1)

It is well-known that Clojure has a long startup time. Even with years of improvement on the JVM and Clojure itself, getting to the REPL still takes seconds. This makes JVM Clojure unsuitable for short-living programs, such as command lines utilities.

Then there is Babashka, which starts instantly and works mostly like JVM Clojure. In Babashka, there is no JVM, instead a custom interpreter runs your Clojure Code. You can't use Java classes except those built into with Babashka. Existing Clojure libraries may or may not work depending on what Java classes they use underneath. Babashka is great for simple scripts, but comes short when you need third-party libraries.

Why do we have to choose between Clojure that works for everything and Clojure that starts fast? If only we could combine the power of JVM Clojure and the speed of Babashka...