A Clojure compiler implemented on top of Chez Scheme https://jolt-lang.github.io/
Find a file
Yogthos fe22fea3e4 Phase 7: LazySeq + PersistentHashSet completion
- phm.janet: LazySeq (realize-once with caching, ls-first/ls-rest/ls-seq/ls-count)
  PersistentHashSet (backed by PHM, phs-conj/phs-disj/phs-contains?/phs-count/...)
  make-lazy-seq creates lazy thunk wrapper with :jolt/lazy-seq type tag
  make-phs creates hash set with :jolt/set type tag
- evaluator.janet: :jolt/set handler in eval-form, disj/set? special forms,
  special-symbol? entries, phm import for compile-time visibility
- core.janet: lazy-seq/iterate macros, set?/disj core fns, make-phs wired
  into hash-set, core-bindings entries for set?/disj/lazy-seq/make-lazy-seq/iterate
  Set support in core-conj/core-contains?/core-count/core-empty?/core-seq/core-get
  LazySeq support in core-first/core-rest/core-count/core-seq
- 9 tests (32-33): lazy-seq basic ops, realize-once caching
  PersistentHashSet construction, conj, disj, count, set? predicate
- 315 ok, 2 fail (pre-existing, unchanged)
2026-06-02 23:24:55 -04:00
.clj-kondo/.cache/v1 fix: add <, >, <=, >= comparison operators to clojure.core 2026-06-02 12:55:16 -04:00
.dirge Phase 7: LazySeq + PersistentHashSet completion 2026-06-02 23:24:55 -04:00
.lsp/.cache bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
src/jolt Phase 7: LazySeq + PersistentHashSet completion 2026-06-02 23:24:55 -04:00
test Phase 7: LazySeq + PersistentHashSet completion 2026-06-02 23:24:55 -04:00
vendor feat: SCI submodule, gensym, doto, defrecord, multi-arity defn 2026-06-02 01:41:44 -04:00
.gitignore gitignore build/ artifacts 2026-06-02 00:10:21 -04:00
.gitmodules feat: SCI submodule, gensym, doto, defrecord, multi-arity defn 2026-06-02 01:41:44 -04:00
fix-core.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
LICENSE Initial commit: Jolt — Clojure interpreter on Janet 2026-06-01 16:48:56 -04:00
preprocess.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
project.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
README.md docs: update README with SCI status, test section, project structure 2026-06-02 09:52:25 -04:00
test-defprotocol.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
test-eval.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
test-form15.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
test-ivar.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
test-load-sci.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
test-parse-utils.janet bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00

Jolt

A Clojure interpreter running on Janet. Jolt reads Clojure source text, evaluates it using an interpreter written in pure Janet, and exposes a Clojure-compatible standard library. The goal is a Janet-hosted SCI runtime — minimal bootstrapping, with SCI as the standard library.

What's inside

Jolt implements the core of Clojure in a single-process Janet project:

Reader — A recursive descent parser for Clojure syntax: symbols, keywords, numbers, strings, characters, lists, vectors, maps, sets, quote forms, reader macros (#(), #_, #?), metadata, deref, and tagged literals.

Evaluator — A tree-walking interpreter with 22 special forms (quote, do, if, def, defmacro, fn*, let*, loop*/recur, throw, try, set!, var, locking, instance?, defmulti, defmethod, deftype, new, ., etc.), syntax-quote with unquote and unquote-splicing, a macro system with &env support, destructuring (:keys and sequential), and namespace forms (ns, require, in-ns).

Core library — 145+ bindings from clojure.core: predicates, math with Clojure arity semantics, comparison, collections, sequences, higher-order functions, string functions, I/O, atoms, macros (when, when-not, if-let, when-let, if-some, when-some, doto, fn, let, defn, defrecord, defprotocol), and SCI bootstrap stubs.

SCI bootstrap — All 317 forms from SCI's 9 core source files (macros, protocols, types, unrestrict, vars, lang, utils, namespaces, core) load with zero failures. 46 namespaces are populated with 900+ bindings. SCI's eval-string is replaced with a Jolt-native implementation.

Quick start

git clone https://github.com/yogthos/jolt.git
cd jolt
git submodule update --init   # pulls vendor/sci
jpm build                      # compiles build/jolt
build/jolt                     # drops into REPL

Build

jpm build

This compiles src/jolt/*.janet into a standalone build/jolt executable. Requires Janet ≥ 1.36 and jpm.

Run

build/jolt

Drops into a read-eval-print loop where you can type Clojure expressions:

user=> (+ 1 2)
3
user=> (map inc [1 2 3])
[2 3 4]
user=> (defn fib [n] (if (< n 2) n (+ (fib (- n 1)) (fib (- n 2)))))
#'user/fib
user=> (fib 10)
55

Test

jpm test

Runs all tests: API, bootstrap, core, evaluator, macro, namespace, reader, types, and SCI load.

Use as a library

(use jolt/api)

(def ctx (init))
(eval-string ctx "(+ 1 2)")       ;; → 3
(eval-string ctx "(map inc [1 2 3])") ;; → [2 3 4]
(eval-string ctx "(def x 42)")    ;; → #'user/x
(eval-string ctx "x")             ;; → 42

(init) returns a context with clojure.core loaded. Pass it to eval-string to evaluate Clojure source. Each context is isolated — use separate contexts for separate evaluation environments.

Project structure

src/jolt/
  types.janet       — Var, Namespace, Context, symbol helpers
  reader.janet      — recursive descent parser for Clojure syntax
  evaluator.janet   — tree-walking interpreter
  core.janet        — 145+ clojure.core bindings
  api.janet         — public API: init, eval-string, eval-string*
  main.janet        — REPL entry point
test/                — 8 test suites + SCI load test
vendor/sci/          — SCI submodule (git submodule)

License

Eclipse Public License 1.0