# Scheme-on-SX Scoreboard **All tests pass: 296 / 296 across 9 suites.** ## Per-suite breakdown | Suite | Passing | Covers | |-------------|--------:|--------| | parse | 62 | R7RS lexer: numbers, strings, chars, vectors, lists, quote/quasi/unquote, line/block/datum comments | | eval | 23 | Self-evaluating literals, symbol lookup, quote, primitive application | | syntax | 49 | if/define/set!/begin/lambda/closures + let/let*/cond/when/unless/and/or | | runtime | 78 | Standard env: variadic arithmetic, type predicates, list/string/char/vector ops, higher-order combinators | | control | 25 | call/cc (escape), raise/guard/with-exception-handler, dynamic-wind | | macros | 20 | define-syntax / syntax-rules incl. tail-rest ellipsis | | reflection | 23 | eval / interaction-environment / null-environment / scheme-report-environment + quasiquote runtime | | records | 9 | define-record-type with constructor / predicate / accessor / mutator | | modules | 7 | define-library + import (minimal — no cond-expand / include / rename) | ## Phases implemented - [x] Phase 1 — Parser - [x] Phase 2 — Evaluator + env.sx **third consumer** - [x] Phase 3 — Syntactic operators (if/lambda/define/set!/begin) - [x] Phase 3.5 — let/let*/cond/when/unless/and/or - [x] Phase 4 — Standard environment + set! cond-bugfix - [x] Phase 5a — call/cc - [x] Phase 5b — exceptions (raise/guard/with-exception-handler/error) - [x] Phase 5c — dynamic-wind (basic, no call/cc-escape tracking) - [x] Phase 6a — define-syntax + syntax-rules (no ellipsis) - [x] Phase 6b — syntax-rules ellipsis (tail-rest, single variable) - [x] Phase 7 — eval / interaction-environment **second consumer for evaluator.sx** - [x] Phase 8 — define-library + import (minimal) - [x] Phase 9 — define-record-type - [x] Phase 10 — quasiquote runtime **second consumer for quoting.sx** - [x] Phase 11 — test.sh + scoreboard ## Deferred - **Phase 6c — hygiene** (scope-set / lifted-symbol Dybvig-style algorithm). Would be the second consumer for the deferred `lib/guest/reflective/hygiene.sx` research-grade kit. Current macros work for common patterns but can capture caller bindings if a macro introduces same-named identifiers. - **Nested quasiquote depth tracking** — `` `\`x\` `` is not properly depth-aware; matches Kernel's deferred state. - **R7RS module rich features**: cond-expand, include, include-library-declarations, `(only ...)` / `(except ...)` / `(prefix ...)` / `(rename ...)` import sets. - **Dotted-pair `(a b . rest)` syntax** at the parser level. Lambda rest-args currently use the `(lambda args ...)` form (bare symbol) instead. - **Full call/cc + dynamic-wind interaction**: re-entry/re-exit of dynamic extents via continuations is not tracked. Pure-eval programs work; call/cc- heavy code with dynamic-wind interleaving doesn't. ## Reflective-kit consumption (chisel ledger) This Scheme port unlocks three reflective-kit extractions from the kernel-on-sx loop's original six-candidate list: | Kit | Status | |----------------------|---------------------------------------------| | env.sx | **Extracted** (third consumer; no adapter) | | class-chain.sx | n/a (no OO in Scheme) | | evaluator.sx | **Unblocked** (second consumer ready) | | quoting.sx | **Unblocked** (second consumer ready) | | hygiene.sx | Awaiting Phase 6c (research-grade) | | combiner.sx | n/a (no fexprs in Scheme) | | short-circuit.sx | n/a (Scheme `and`/`or` are syntactic, not operative) | The kit-extraction commits themselves are follow-on work — kit code is staged in the proposed sections of `plans/kernel-on-sx.md`; Scheme's consumer code satisfies the two-consumer rule for `evaluator.sx` and `quoting.sx`. ## Substrate stats - parser.sx — 281 LoC - eval.sx — ~970 LoC - runtime.sx — ~580 LoC - Tests — ~1500 LoC across 9 files Total Scheme implementation ≈ 1830 LoC.