Skip to content

Instantly share code, notes, and snippets.

@mfikes
Last active January 6, 2024 07:19
Show Gist options
  • Save mfikes/844a9e6659a30eaf44dcb9170ebc739d to your computer and use it in GitHub Desktop.
Save mfikes/844a9e6659a30eaf44dcb9170ebc739d to your computer and use it in GitHub Desktop.
Fast Clojure REPL

An experimental change for fast Clojure REPL startup:

  1. Download the JAR: clojure-1.8.0-fast.jar
  2. Launch it via java -jar clojure-1.8.0-fast.jar

The code used to create this JAR is on GitHub.

What's it doing?

It is:

  1. Assuming you are launching a REPL.
  2. Statically printing the Clojure version and first prompt before anything else is done.
  3. Letting the rest load, but trying to carefully do it via reflective calls, after the printing in (2) is done.

A robust solution couldn't make the assumption in (1), but would probably have to do some argument processing in Java to determine if a REPL is being launched. (This is essentially what Planck does: The argument processing is done in native code, not ClojureScript.)

A demo:

 




 

@DogLooksGood
Copy link

Can this be used to improve the startup time for lein or boot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment