Skip to content

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.


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 builtfe-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.

  1. 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).
  2. 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.
  3. “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.
  4. KEC Core (standard §4) is the canonical prelude vocabularycmp / list / hof / ctrl / def / str / pred + the authoring macros. The lib/ library (runtime-arch §5) is built to §4.
  5. The FFI bridge contract (standard §6) governs exposing any C library as Stdlib — the bind seam, C↔Lisp marshalling, FE_TPTR handle GC, tier gating, fe_error propagation, arena lifetime.
  6. 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.

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-LispKEC Lisp doc-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-LispKEC Lisp doc-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.