Jolt: a self-hosting Clojure that compiles to Scheme, no JVM required
Jolt is a Clojure implementation that abandons the JVM entirely, targeting Scheme instead — Chez Scheme when running natively, and Gambit when compiling to JavaScript. The compiler itself is written in Clojure and bootstraps by compiling its own source: it parses Clojure, lowers it to a host-neutral intermediate representation, and emits Scheme. The project claims broad compatibility, promising that most portable Clojure runs unchanged, including persistent collections, lazy and infinite seqs, transducers, multimethods, protocols and records, metadata, namespaces, the full reader, and runtime eval.
The more interesting engineering claims are around concurrency and numerics. Where many alternative Clojure runtimes fake or drop threading, Jolt says future, promise, agent, and pmap run on real OS threads over a shared heap to match JVM semantics, with core.async supplying channels and go blocks. It also reproduces Clojure’s numeric tower — exact integers with bignums, exact ratios such as 1/2, and flonum doubles — alongside HAMT-backed maps and sets, 32-way-trie vectors, and genuine mutable transients for scratch work.
Distribution is the pitch that stands out for practitioners: jolt build performs ahead-of-time compilation of the runtime, standard library, application, and dependencies into a single self-contained executable that needs neither Chez nor a JVM to run. Installation is a single bundled binary via Homebrew or a shell script, and the toolchain resolves deps.edn, runs aliases, and ships an nREPL server for live REPL-driven development with CIDER, Calva, or Cursive. The live in-browser demo is Jolt itself, compiled to JavaScript through the Gambit backend, running a trimmed build that omits regex.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.