jolt/docs/spec
Dmitri Sotnikov 61d621521b
Library ports: get hiccup running, verify malli (reader + interop fixes) (#127)
* Reader: #() params survive syntax-quote (auto-gensym names)

#(...) named its synthesized params with bare gensyms, so a #() written inside a
syntax-quote had its params qualified to the current ns by sq-symbol — and a
qualified symbol isn't a valid fn param. hiccup's compiler emits
`(let [sb# ..] (iterate! #(.append sb# %) ..)), which broke with "Unable to
resolve symbol: ns/_NNNN".

Name the params with a trailing # (auto-gensym suffix, like Clojure's p1__N#) so
syntax-quote maps them consistently and leaves them unqualified. Harmless outside
a backtick (just a regular symbol name).

* interop: String/valueOf static + String is a CharSequence

Two interop gaps surfaced bringing up hiccup and malli:
- String/valueOf(Object): hiccup's compiler stringifies attribute values with
  (String/valueOf (or arg "")). Added the static — "null" for nil, else core-str.
- (instance? CharSequence s) returned false for a string; String implements
  CharSequence, and malli's :re validator gates on it before matching, so :re
  schemas always failed. instance-check now answers true for strings.

---------

Co-authored-by: Yogthos <yogthos@gmail.com>
2026-06-15 19:36:13 +00: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 Library ports: get hiccup running, verify malli (reader + interop fixes) (#127) 2026-06-15 19:36:13 +00:00
03-special-forms.md core: variadic bit ops, set? covers sorted sets, if rejects extra forms 2026-06-11 17:04:26 -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 core: one alias store (jolt-ark); '.' classified as the special form it is 2026-06-10 18:37:19 -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.