ADR-0037: KEC Lisp — the named language standard (Fe Kernel + Core + Stdlib + Cart Grammar)
Reference (the standard itself): the KEC Lisp Language Standard — the full language standard (now published at the standalone KEC Lisp site). This ADR ratifies it; the standard carries the detail. Per Spec Hygiene Rule 1, this ADR references rather than restates.
Related: kec-lisp-runtime-architecture.md (systems axis — where code runs), ui-design-language.md (UI axis). ADR-0001 (Lisp as sole cart authoring language), ADR-0004 (Fe VM), ADR-0005 (FFI surface — 66 primitives), ADR-0002 / ADR-0007 / ADR-0016.
Context
Section titled “Context”The KN-86 runs Lisp (ADR-0001) — the fiction and the substrate are a Lisp deck. But the language behind that fiction was never named or fixed as a standard. It existed as three disconnected pieces: a kernel reference (the vendored Fe interpreter, “Fe-Lisp”), a runtime FFI surface enumerated across ADR-0005 + the nosh-api/ docs, and a prelude that was described but never built — fe-lisp/builtins.md refers to “runtime-shipped helpers loaded once at boot” (map, filter, cond, defcell) that do not exist in the code (the cart loader runs bare fe_read+fe_eval with no prelude injection). There was no single document a cart author, a system-screen author, or the workbench could read to know what language they are writing in.
This ADR names the language and ratifies its standard as canon.
Decision
Section titled “Decision”- The device’s authoring language is KEC Lisp — a named, versioned language, not an unnamed Fe-plus-glue composite. KEC Lisp = Fe Kernel (frozen
rxi/fe) + KEC Core (the prelude) + KEC Stdlib (the runtime FFI surface) + Cart Grammar (the authoring DSL on top). - The KEC Lisp Language Standard is the canonical, prescriptive standard. The implementation conforms to the standard; the standard is not a description of whatever happens to be built. A runtime that does not provide KEC Core (standard §4) with the specified semantics, or that violates the FFI bridge contract (§6), is non-conforming.
- “Fe-Lisp” is the Fe Kernel — Layer 0 of KEC Lisp. The runtime-architecture and UI docs that say “Fe-Lisp” resolve to “KEC Lisp’s Fe kernel”; a doc-wide naming sweep is a tracked follow-on.
- KEC Core (standard §4) is the canonical prelude vocabulary —
cmp / list / hof / ctrl / def / str / pred+ the authoring macros. Thelib/library (runtime-arch §5) is built to §4. - The FFI bridge contract (standard §6) governs exposing any C library as Stdlib — the
bindseam, C↔Lisp marshalling,FE_TPTRhandle GC, tier gating,fe_errorpropagation, arena lifetime. - Command-launcher availability follows the binding-set (standard §7) — a context’s command vocabulary is the Core + Stdlib symbols bound into it; carts get no launcher.
Consequences
Section titled “Consequences”Positive
- One named, prescriptive DSL that every cart, ported system screen, and the workbench target. The end goal — a clear DSL to accelerate KN-86 development — has a canonical referent.
- KEC Core stops being a hand-wave: §4 is the contract the
lib/build conforms to. - The keyboard’s 14 Lisp-primitive keys now have a defined language to be the hardware-accelerated subset of.
Costs / follow-ons
- A
Fe-Lisp→KEC Lispdoc-wide naming sweep (standard §9.3). - KEC Core’s
number?/string?/symbol?/fn?predicates require one new Stdlib primitive(type-of x)— an ADR-0005 amendment (66 → 67), mandated by standard §4.7. - The
lib/Core library and Cart Grammar v2 are build work that must conform to the standard.
Documentation Updates (REQUIRED — Spec Hygiene Rule 3)
Section titled “Documentation Updates (REQUIRED — Spec Hygiene Rule 3)”-
docs/adr/ADR-0037-kec-lisp-language-standard.md— this file. -
docs/adr/README.md— index entry at top. -
docs/architecture/kec-lisp-language-standard.md— Status flipped to Canonical, ratified by this ADR; §4 + §9 reframed from tentative to prescriptive. (The standard has since moved to the KEC Lisp site.) -
Fe-Lisp→KEC Lispdoc-wide sweep (runtime-arch doc, UI doc,fe-lisp/, ADR-0001/0002/0004 cross-refs) — tracked follow-on, not in this PR. -
(type-of x)Stdlib primitive — ADR-0005 amendment, tracked follow-on.