Jolt targets Clojure semantics but runs on Scheme, not the JVM. Most portable Clojure runs unchanged: persistent collections (32-way-trie vectors, HAMT maps/sets, RRB vectors), the numeric tower (exact integers, bignums, ratios, doubles, and BigDecimal with M literals and with-precision), lazy and infinite sequences, transducers, destructuring, multimethods with hierarchies, protocols and records, metadata, namespaces, atoms, refs and software transactional memory (ref/dosync/alter/commute/ref-set/ensure), future/promise/agent/pmap, clojure.core.async, and runtime eval/load-string/defmacro all behave as on the JVM. = is category-aware ((= 3 3.0) ⇒ false) and == is value-equality, exactly as in Clojure.
The sections below are the genuine divergences, where the absence of the JVM actually shows through. Every example on this page is checked against reference JVM Clojure; the machine-readable list the conformance suite gates against lives in test/conformance/known-divergences.edn, which is the authority when this page and it disagree.
No JVM, no Java interop
There is no JVM underneath, so there is no general Java interop, no reflection, and no gen-class/proxy. Interop syntax (Class., Class/staticMethod, .method) resolves only against a shimmed subset of the java.* standard library; a class token is a name, not a loaded class. See Host Interop for what's covered, how to register a class Jolt doesn't ship, and how to add a method to one it only part-shims.
To call C libraries directly (the way the SQLite/Postgres and HTTP-client libraries work), Jolt has a foreign-function interface. See Native Interop.
The java.* shims are not the JVM
A shimmed class implements its JVM counterpart's API, in Scheme. It does not bring the JVM's runtime along with it, so a shim can behave correctly call-for-call while everything around it follows Scheme's rules rather than the JVM's. When something surprising happens, check whether the explanation you have in mind is a JVM-runtime explanation:
- No classloaders. Nothing loads classes at runtime.
Class/forNameanswers only for names the runtime already shims and throws for anything else, and there is no class path scanning or service-loader discovery. - No JVM memory model to tune. Garbage collection is Chez's. JVM heap flags, GC ergonomics, and reference/finalizer semantics have no counterpart.
- Recursion goes much deeper. The stack lives on the heap, so the limit is sized from memory (80% of the heap ceiling by default, per thread) rather than from
-Xss. Recursion the JVM stops at ten or twenty thousand frames runs to millions here; past the limit it throws the samejava.lang.StackOverflowError, with a message naming the limit where the JVM's isnil.JOLT_STACK_LIMITsets or disables it. See Stack depth. - Reflection answers about the model, not a class file.
(count (.getMethods String))is5where the JVM reports 96, and(supers String)lists 4 ancestors rather than 6: Jolt reports what its registries know a class declares, and a class whose methods are implemented as a Schemecondhas nothing to enumerate.
Numbers
Jolt has one integer type. The narrowing constructors are accepted and return the same value, so the class collapses:
(class (byte 5)) ;; Jolt: java.lang.Long JVM: java.lang.Byte
(class (int 5)) ;; Jolt: java.lang.Long JVM: java.lang.Integer
(class (bigint 21)) ;; Jolt: java.lang.Long JVM: clojure.lang.BigInt
Arithmetic values agree; only the box type differs. Code that dispatches on (class n) or on instance? for a numeric type is the code that notices.
Two related edges: (format "%x" -1) prints "ff" (the narrowest width that holds the value) where the JVM pads to a 64-bit "ffffffffffffffff"; and (double \a) returns 97.0 where the JVM throws ClassCastException.
The one integer type also means a BigInt inside the long range is indistinguishable from a long: (Math/abs 2N) answers 2, where the JVM finds no abs taking a BigInt and throws.
Math and StrictMath transcendentals (sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, exp, expm1, log, log1p, pow, hypot, and clojure.math's same functions) come from the platform's libm, so their last digit can differ from the JVM's: (Math/sinh 2.0) is 3.6268604078470186 with macOS's libm and 3.626860407847019 on JDK 21. The JVM's own answer varies too, since HotSpot computes some of these with per-CPU intrinsics rather than StrictMath's fdlibm.
Sequences and collections
Chunking differs in one place: building a dedupe sequence realizes nothing on Jolt, where the JVM forces the first 32-element chunk just to construct it. Code that depends on chunk-boundary side effects sees a different number of them.
Codepoint strings
Strings are Chez strings: codepoint-indexed, with no UTF-16 surrogate pairs. count, seq, subs, and nth all index codepoints, so (count "😀") is 1 where the JVM answers 2, and subs never splits a character in half. Only code doing UTF-16 unit arithmetic notices the difference.
The same model holds at a Writer: write(int) with a supplementary code point (U+10000 to U+10FFFF) writes it whole, where the JDK keeps the int's low 16 bits and writes a different character without an error. A library that writes text char by char with (.write w (int c)) keeps its emoji. Ints past U+10FFFF or below 0 keep the low 16 bits, as on the JDK.
(let [w (java.io.StringWriter.)] (.write w (int 0x1F512)) (mapv int (str w)))
;; Jolt: [128274] JVM: [62738]
Regex engine
Patterns compile through irregex (vendored), not java.util.regex, behind a translator that reads Java's grammar: \p{…} classes, the line-terminator set \n \r \r\n NEL LS PS for . ^ $ (with (?d) narrowing it to \n), the inline flags, look-around, atomic groups, back-references, \Q…\E, and a Matcher's find(int) / region. Capturing patterns use irregex's backtracking matcher, which is the JVM's own engine, so submatch semantics agree; group-free patterns get a DFA when it is affordable and the same backtracker when it is not. Pattern/compile takes the JDK's flags word (Pattern/CASE_INSENSITIVE, MULTILINE, DOTALL, COMMENTS, UNIX_LINES, LITERAL …), but a Jolt regex is its source string and nothing else, so the flags are spelled into it as the equivalent inline group: .flags reads them back, and .pattern answers "(?i)a.c" where the JVM keeps "a.c". UNICODE_CHARACTER_CLASS is accepted and not yet applied: \w \d \s stay ASCII under it. Divergences that remain are recorded in known-divergences.edn; the one most likely to be met is that a lone surrogate code point has no representation in a code-point string (see above), so (format "%c" 0xD800) prints U+FFFD.
The reader
Reader conditionals (#?(…)) are read by default; on the JVM they need {:read-cond :allow} and throw otherwise. The feature set is #{:jolt :clj :default}, so a :jolt clause written before the :clj one is how a library ships a Jolt-specific branch: see Cljc Interop.
Three more reader differences, all in the direction of reading something the JVM refuses:
(read-string "") ;; Jolt: nil JVM: throws (EOF)
(read-string "2r1010N") ;; Jolt: 10 JVM: NumberFormatException
(read-string "#foo/bar 5") ;; Jolt: #foo/bar 5 JVM: throws (no reader fn)
An unregistered tag reads as an inert tagged literal rather than failing, so data carrying a tag you have not registered can be inspected before you decide what to do with it. That is read-string only: the same tag in a source file being compiled is an error naming the tag, the way the JVM's reader raises on it.
The # dispatch table is also open for punctuation, which Clojure's is not: jolt.reader/set-dispatch-macro! puts a reader function on a character. Jolt ships one, #$"a ~{x} b ~(inc x)", applying clojure.core.strint's interpolation grammar at read time. Additive in the same direction as everything else in this section (every #<punctuation> sequence is a read error on the JVM), but a file using it will not read on Clojure. See Reader Macros & Interpolation.
Namespaces and vars
ns-aliases also takes no argument, answering for the current namespace; on the JVM it takes one.
A require cycle on one thread loads. a.core requiring b.core, whose ns form requires a.core back, is the JVM's Cyclic load dependency error; Jolt's loader is modeled on Java class initialization instead, so the thread that owns an in-progress load and asks for it again gets the partially loaded namespace and continues. b.core sees whatever a.core had defined before the require. The same machinery detects a cross-thread or cross-fiber load deadlock the JVM cannot, and raises there instead. Code that relies on the JVM refusing its own cycle does not get the refusal here.
Printing
Jolt renders a lazy sequence by its contents, which is friendlier and deliberately not the JVM's answer:
(str (map inc [1 2]))
;; Jolt: "(2 3)" JVM: "clojure.lang.LazySeq@402"
Where Jolt is more permissive
Several operations with one reasonable meaning succeed here and throw on the JVM. This is a superset: portable JVM code behaves identically, and only code that depends on the throw differs.
(distinct #{1 2 3}) ;; Jolt: (1 3 2) JVM: UnsupportedOperationException
(keys [[:a 1] [:b 2]]) ;; Jolt: (:a :b) JVM: ClassCastException
(.-value {:value 41}) ;; Jolt: 41 JVM: IllegalArgumentException
(clojure.string/replace "abc" \b "XX") ;; Jolt: "aXXc" JVM: ClassCastException
(let [^long x 2.7] x) ;; Jolt: 2 JVM: compile error
(.-field m) reading a map as an object is the one worth calling out. It makes a map interchangeable with a record for field access, and it will not port back.
A nil subject puns in clojure.string, subs, the regex searches, alength and aclone, as it already does in get and nth. The JVM throws NullPointerException in all of these:
(clojure.string/upper-case nil) ;; Jolt: nil JVM: NullPointerException
(clojure.string/includes? nil "a") ;; Jolt: false JVM: NullPointerException
(subs nil 1) ;; Jolt: nil JVM: NullPointerException
(re-find #"a" nil) ;; Jolt: nil JVM: NullPointerException
(alength nil) ;; Jolt: 0 JVM: throws
(aclone nil) ;; Jolt: nil JVM: throws
Only the subject puns. A nil needle, replacement or pattern beside a real string still throws, as do method calls on nil and reads through an array type hint.
On the I/O side, line-seq and file-seq are duck-typed and accept a path string, with-open closes anything carrying a :close function, and spit is atomic: a failure leaves the original file intact, which is stronger than the JVM's guarantee.
Where Jolt is stricter
A call the compiler can prove always throws is a compile error (analyze/type-error, see Getting Started). The JVM compiles such a call and throws only if it runs, so a call in a branch that never runs is refused here and accepted there:
(defn f [x] (if (string? x) (inc x) x))
;; Jolt: error[analyze/type-error]: `inc` requires a number, but argument 1 (`x`) is a string ...
;; JVM: #'user/f, and (f 1) is 1
Dependencies: org.clojure/clojure is terminal
org.clojure/clojure contributes no transitive dependencies in Jolt, so a project that declares only Clojure does not get spec.alpha and core.specs.alpha along with it. Requiring clojure.spec.alpha then fails with a message that reads like a coverage gap rather than a missing coordinate:
Could not locate clojure/spec/alpha.jolt (or .clj/.cljc) on the source roots
Declare them explicitly:
{:deps {org.clojure/clojure {:mvn/version "1.12.0"}
org.clojure/spec.alpha {:mvn/version "0.5.238"}
org.clojure/core.specs.alpha {:mvn/version "0.4.74"}}}
The same applies to org.clojure/clojurescript.
Coverage
clojure.core is implemented function by function against a conformance corpus whose expected values come from reference JVM Clojure. Coverage is broad but not total: a namespace can load with most functions working and a few not yet implemented. The per-function coverage lives in the language specification.
The .jolt extension
A namespace's source can be foo.jolt as well as foo.clj or foo.cljc, and the three are the same language; the reader, analyzer, and emitter never look at the extension. .jolt is a marker for readers and tooling. It says the file uses jolt-specific interop and is not portable Clojure. It resolves first, so a library can ship a portable foo.cljc next to a foo.jolt that wins on Jolt, the way .clj wins over .cljc on the JVM. data_readers.jolt works like data_readers.clj too. See Cljc Interop.