Skip to content

kernel: re-vendor Tarver's S41.2 (2026-07-11 refresh) - #18

Merged
pyrex41 merged 1 commit into
masterfrom
kernel/tarver-s41-refresh-20260711
Jul 14, 2026
Merged

kernel: re-vendor Tarver's S41.2 (2026-07-11 refresh)#18
pyrex41 merged 1 commit into
masterfrom
kernel/tarver-s41-refresh-20260711

Conversation

@pyrex41

@pyrex41 pyrex41 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Re-vendors the KLambda kernel from Mark Tarver's S41.2 (2026-07-11 refresh), replacing the community ShenOSKernel-41.2 this repo previously vendored byte-identically.

This is a port migration, not a drop-in. Upstream reused the "41.2" version number for a restructured kernel of a different lineage — Tarver's own CommonLisp reference kernel, not the porter-oriented ShenOSKernel. Canonical source: pyrex41/shen-s41.1 tag s41.2-pristine-20260711 (commit 11fc51b); byte-identical to shenlanguage.org/Download/S41.2.zip (sha256 51becbfd…53ee836, Last-Modified 2026-07-11). See kernel/klambda/PROVENANCE.md.

Upstream delta (vs community 41.2)

Area Community ShenOSKernel-41.2 Tarver S41.2 refresh
Init shen.initialise in init.kl (load-order independent) No shen.initialise — init forms inline in declarations.kl (globals, arity table, external-symbols) and types.kl (~160 datatype declares); load-order dependent
get/put/unput dict.kl layer moved into sys.kl, pure-KL over hash/limit/<-vector/vector-> + shen.change-pointer-value/shen.remove-pointer; no dict layer, no native pointer prims
REPL shen.repl, shen.toplevel-display-exception shen.shen/shen.loop; no toplevel-display-exception (loop prints raw error string)
Files +dict.kl +init.kl +stlib.kl +compiler.kl(shen-cl) +backend.kl (KL→CL codegen); the other four gone

What this PR does

  • Vendors 14 shared modules + backend.kl (provenance only — not booted/compiled to Go). Removes dict.kl, init.kl, stlib.kl, compiler.kl. Community extensions retained; only extension-launcher.kl is booted.
  • Boot rework (compiled/script.kl, precompile.kl, bctogo.shen): load modules in upstream install.lsp order (declarations.klt-star.kltypes.kl, so the arity table / typechecker exist before types.kl's ~160 declare forms run at load), no shen.initialise call, symbol table now emitted on launcher.go (last file). init.go/dict.go deleted.
  • cmd/shen/main.go: regist reordered to the new load order; native hash swapped in after SysMain, before the first dict write (DeclarationsMain/TypesMain build the bucketed *property-vector* inline — populate-time and get-time hash must match); REPL error handler prints the raw string instead of calling the absent shen.toplevel-display-exception.
  • cmd/ratatoskr-build: compiler-image boot updated (new order, no shen.initialise, native hash after sys.kl); generated static program binds native hash before kernel chunks (init is inline, so no post-chunk swap that would desync the dict hash) and treats manifest init= as optional.

Test status — green

Check Result
go build ./cmd/shen ./cmd/kl ./cmd/ratatoskr-build ./codegen ./kl ✅ pass
go test -short ./kl/ ./cmd/shen/ 188 pass
Canonical certification (go test -count=1 ./certification/) PASS (~11–18s)
REPL / type checker / datatypes / prolog / launcher CLI ✅ verified live
Ratatoskr stage-2 (go) end-to-end fib + metaeval pass; four-target parity gate (lua/rust/go/js: build / vs-truth / two-boot / two-pass) all ok

Stage-2 was validated against a fresh new-kernel shaken directory produced by the ratatoskr PR #10 branch (commit 8ae561a).

Notes

  • Non-launcher extensions (features, expand-dynamic, programmable-pattern-matching) are vendored but not booted and were not re-validated against this kernel (they were written against the community API) — unchanged from before this PR.
  • backend.kl is vendored for provenance but intentionally not part of the Go boot/codegen.

🤖 Generated with Claude Code

Replace the community ShenOSKernel-41.2 that this repo vendored
byte-identically with Mark Tarver's re-uploaded S41.2 (2026-07-11).
Upstream REUSED the "41.2" version number for a restructured kernel of a
different lineage (Tarver's CommonLisp reference kernel), so this is a
port migration, not a drop-in refresh. Canonical source: pyrex41/shen-s41.1
tag s41.2-pristine-20260711 (commit 11fc51b); byte-identical to
shenlanguage.org/Download/S41.2.zip, sha256 51becbfd...53ee836.

Kernel structural changes handled:
- No shen.initialise wrapper. Init forms are inline in declarations.kl
  (globals + arity table + external-symbols) and types.kl (~160 datatype
  declares), so the kernel is load-order DEPENDENT again. Boot now loads
  modules in upstream install.lsp order and runs each module's top-level
  forms as its generated Main thunk is called; the standalone
  (shen.initialise) call is gone.
- get/put/unput moved into sys.kl (pure-KL over hash/limit/<-vector/
  vector-> plus shen.change-pointer-value / shen.remove-pointer). No dict
  layer, no native pointer primitives; shen-go never overrode get/put
  natively, so nothing to reconcile.
- REPL entry is shen.shen / shen.loop; there is no
  shen.toplevel-display-exception. The Go REPL loop now prints the raw
  error string like shen.loop does.

Vendoring:
- 14 shared modules replaced + backend.kl added (Tarver's KL->CL codegen,
  vendored for provenance, NOT booted/compiled to Go).
- Removed dict.kl, init.kl, stlib.kl, and the shen-cl compiler.kl artifact.
- Community extensions retained; only extension-launcher.kl is booted.

Codegen/runtime:
- compiled/script.kl, precompile.kl, bctogo.shen: new module set + load
  order; symbol table now emitted on launcher.go (last file), init.go/
  dict.go removed.
- cmd/shen/main.go: regist reordered, native hash swapped in after SysMain
  and before the first dict write (DeclarationsMain/TypesMain).
- cmd/ratatoskr-build: compiler-image boot updated to the new order/no
  shen.initialise; generated program binds native hash before kernel
  chunks (init is inline, so no post-chunk swap) and treats manifest init=
  as optional.

Green: go build, 188 unit tests, and the canonical certification suite all
pass; REPL, type checker, datatypes, prolog, and the launcher CLI verified.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pyrex41
pyrex41 marked this pull request as ready for review July 14, 2026 11:53
@pyrex41
pyrex41 merged commit 35b80c0 into master Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant