Jolt: Clojure compiler implemented with Chez Scheme

mark_l_watson1 pts2 comments

Jolt — Clojure on Scheme

Why Jolt?

Self-Hosted Compiler

Reads Clojure, analyzes it to a host-neutral IR, emits Scheme, and runs it — on Chez natively, or on Gambit compiled to JavaScript. The compiler is written in Clojure and compiles itself.

Standalone Binaries

jolt build ahead-of-time compiles a project — runtime, standard library, app, and its deps — into a single self-contained executable. No Chez, no JVM, no source needed to run it.

Real Concurrency

future/promise/agent/pmap run on OS threads over a shared heap, matching JVM semantics. core.async provides channels and go blocks.

Full Numeric Tower

Exact integers and bignums, exact ratios ((/ 1 2) ⇒ 1/2), and flonum doubles. = is category-aware; == is value-equality.

Persistent Data

Immutable vectors (32-way tries), cons lists, and HAMT maps/sets with Clojure value semantics. Transients are real mutable scratch collections.

Clojure-Compatible

Lazy/infinite seqs, transducers, destructuring, multimethods, protocols/records, metadata, namespaces, runtime eval, and the full reader.

Quick Start

Install the self-contained jolt binary — it bundles the runtime, compiler, and standard library, so there's nothing else to install.

# Homebrew<br>brew install jolt-lang/jolt/jolt

# or the install script (Linux / macOS)<br>curl -sL https://raw.githubusercontent.com/jolt-lang/jolt/main/install | bash

jolt -e '(+ 1 2)' # => 3<br>Or run from a clone (needs Chez Scheme) — no build step, the bootstrap seed is checked in:

git clone --recurse-submodules https://github.com/jolt-lang/jolt.git<br>cd jolt<br>bin/jolt -e '(+ 1 2)' # => 3

Usage

Evaluate an expression

$ bin/jolt -e '(->> (range 10) (filter even?) (map (fn [x] (* x x))) (reduce +))'<br># 120<br>$ bin/jolt -e '(/ 1 2)'<br># 1/2

Run a project

bin/jolt run -m myapp.core # resolve deps.edn, then run -main<br>bin/jolt -M:test [args] # run an alias's :main-opts<br>bin/jolt path # print the resolved source roots

Compile a standalone binary

bin/jolt build -m myapp.core -o myapp # single self-contained executable<br>./myapp arg1 arg2 # runs anywhere; args reach -main<br># --opt for the optimized build, --dev for an unoptimized one

nREPL

bin/jolt --nrepl-server # auto-resolves deps.edn, writes .nrepl-port<br># connect CIDER / Calva / Cursive via the .nrepl-port file, then<br># redefine a var and the next call sees it — no restart<br>Develop against a live process: see REPL-Driven Development.

Read the documentation for installation, writing libraries, and host interop.

Differences from Clojure

Jolt targets Clojure semantics but runs on Scheme, not the JVM. Most portable Clojure runs unchanged — persistent collections, the numeric tower, lazy seqs, transducers, multimethods, protocols/records, atoms, future/agent/pmap, core.async, runtime eval, and the full reader all behave as on the JVM. The genuine divergences:

AspectDifference

Java interopNo JVM, so no general Java interop, reflection, or gen-class/proxy — a shimmed subset of java.* is available, plus a C FFI<br>BigDecimalNot available (decimal? is always false); the rest of the numeric tower matches<br>RegexCompiled by irregex, not java.util.regex — common patterns work, some Java-specific features differ

jolt clojure scheme install java compiler

Related Articles