jolt/docs/spec
Yogthos d06b3fe636 spec: rows for every untested var (131 -> 0); the probes found five real bugs
test/spec/untested-vars-spec.janet adds 143 rows asserting jolt's documented
behavior for the whole implemented-untested category — primed arithmetic,
the array/aset/coercion stubs, unchecked-*, the chunk family, JVM-shape
stubs (class/bean/proxy/memfn as resolve-only or :throws), ns/REPL
machinery, and the misc seqs. tools/spec_coverage.py now checks each var as
a whole TOKEN in the test sources (call-position-only matching missed *1,
+', ., .., /, and bare transducer refs like cat).

Writing rows from probed truth surfaced five real bugs, all fixed:
- comp with a jolt-IFn stage silently returned nil ((comp seq :content)) —
  raw Janet keyword application is not jolt invoke. comp is the canonical
  overlay defn now (fixed-arity composed fn, so the hot 1-arg path is two
  direct calls); the seed keeps a private td-comp only for the transducer
  machinery. hof bench +9% vs native, the price of correct IFn dispatch.
- extend (the fn) was a nil-expanding stub MACRO shadowing any definition;
  it's a real fn over register-method now, and extends? (a constant-false
  stub) is real over extenders
- (.. x f g) hit the 'ClassName.' constructor branch (a name ending in a
  dot) and died; .. is the canonical threading macro now
- aclone errored on pvecs; ns-interns/ns-imports returned live host tables
  that count/seq reject (now structs)

Thread/sleep + Thread/yield land as Thread statics beside Math/: sleep parks
the WORKER's own event loop (each future thread has one), which makes timed
deref provably fire — futures-spec gains the timeout-fires, sleep-in-body,
and timed-out-future-still-completes rows. The futures impl itself already
ran on real OS threads (ev/spawn-thread + marshalled results); jolt-ejx was
stale.

Dashboard: implemented+tested 433 -> 564 of 694; implemented-untested and
missing-portable are both EMPTY. Gate: jpm exit 0, all tests passed.
2026-06-10 17:52:30 -04:00
..
00-front-matter.md docs: spec §2 (reader) — grammar, reader-macro catalog, syntax-quote contract 2026-06-10 11:23:38 -04:00
02-reader.md core: #inst instant values + syntax-quote literal collapse (spec 2.3/2.4) 2026-06-10 12:19:23 -04:00
03-special-forms.md docs: language specification RFC + spec skeleton with normative exemplars 2026-06-10 10:53:44 -04:00
09-core-library.md docs: language specification RFC + spec skeleton with normative exemplars 2026-06-10 10:53:44 -04:00
coverage.md spec: rows for every untested var (131 -> 0); the probes found five real bugs 2026-06-10 17:52:30 -04:00
README.md docs: language specification RFC + spec skeleton with normative exemplars 2026-06-10 10:53:44 -04:00

The Clojure Language Specification (Draft)

A normative, implementation-independent specification of the Clojure language, developed alongside jolt's self-hosted compiler and validated by its executable conformance suites. Why: Clojure has no spec — every alternative implementation re-derives semantics from the reference implementation and folklore. See the RFC for motivation, scope, evidence sources, and process: ../rfc/0001-language-specification.md.

Documents

Doc Content Status
00-front-matter.md conformance terms, entry format, host classification drafted
01-evaluation.md08-macros.md see chapter plan in front matter planned
03-special-forms.md special-form catalog + normative exemplars (if, let*) exemplars
09-core-library.md per-var entry format + exemplars (first, reduce, parse-uuid) exemplars
coverage.md generated dashboard over the 694-var surface generated

Regenerate the dashboard after surface changes: python3 tools/spec_coverage.py (requires clojuredocs-export.json in the repo root and a working jolt checkout).

Current numbers (2026-06-10)

Of the 694 clojure.core vars in the ClojureDocs inventory:

  • 380 implemented in jolt and exercised by the behavioral suites
  • 154 implemented but not directly tested — each gets a test with its spec entry
  • 35 portable but missing from jolt (parse-long/parse-double/ parse-boolean, update-keys/update-vals, macroexpand, time, partitionv/partitionv-all/splitv-at, with-redefs, with-open, reader fns, ns-introspection stragglers, …) — tracked as implementation gaps
  • 22 resolvable in code but invisible to ns introspection (resolve/ns-publics can't see seed-fallback names like compare, gensym, type) — a conformance finding in its own right
  • the rest classified host/JVM/concurrency (see dashboard)

How this connects to the test suites

  • test/integration/conformance-test.janet — 302 assertions, each run through three independent execution paths (interpreter, bootstrap compiler, self-hosted compiler) that must agree. Spec entries cite these.
  • test/spec/*.janet — ~1,500 behavioral cases organized by topic.
  • vendor/clojure-test-suite — the cross-dialect suite (≥4081 assertions passing); dialect splits there are classification evidence.
  • jank's per-construct corpus (~/src/jank/compiler+runtime/test/jank) is the granularity model for §2/§3 conformance.

The invariant: every numbered normative statement names its conformance test, or is marked UNVERIFIED. The spec cannot drift from the implementations that check it.