kernel: re-vendor Tarver's S41.2 (2026-07-11 refresh) - #18
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.1tags41.2-pristine-20260711(commit11fc51b); byte-identical toshenlanguage.org/Download/S41.2.zip(sha25651becbfd…53ee836, Last-Modified 2026-07-11). Seekernel/klambda/PROVENANCE.md.Upstream delta (vs community 41.2)
shen.initialiseininit.kl(load-order independent)shen.initialise— init forms inline indeclarations.kl(globals, arity table, external-symbols) andtypes.kl(~160 datatypedeclares); load-order dependentget/put/unputdict.kllayersys.kl, pure-KL overhash/limit/<-vector/vector->+shen.change-pointer-value/shen.remove-pointer; no dict layer, no native pointer primsshen.repl,shen.toplevel-display-exceptionshen.shen/shen.loop; notoplevel-display-exception(loop prints raw error string)dict.kl+init.kl+stlib.kl+compiler.kl(shen-cl)backend.kl(KL→CL codegen); the other four goneWhat this PR does
backend.kl(provenance only — not booted/compiled to Go). Removesdict.kl,init.kl,stlib.kl,compiler.kl. Community extensions retained; onlyextension-launcher.klis booted.compiled/script.kl,precompile.kl,bctogo.shen): load modules in upstreaminstall.lsporder (declarations.kl→t-star.kl→types.kl, so the arity table / typechecker exist before types.kl's ~160declareforms run at load), noshen.initialisecall, symbol table now emitted onlauncher.go(last file).init.go/dict.godeleted.cmd/shen/main.go:registreordered to the new load order; nativehashswapped in afterSysMain, before the first dict write (DeclarationsMain/TypesMainbuild the bucketed*property-vector*inline — populate-time and get-time hash must match); REPL error handler prints the raw string instead of calling the absentshen.toplevel-display-exception.cmd/ratatoskr-build: compiler-image boot updated (new order, noshen.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 manifestinit=as optional.Test status — green
go build ./cmd/shen ./cmd/kl ./cmd/ratatoskr-build ./codegen ./klgo test -short ./kl/ ./cmd/shen/go test -count=1 ./certification/)Stage-2 was validated against a fresh new-kernel shaken directory produced by the ratatoskr PR #10 branch (commit
8ae561a).Notes
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.klis vendored for provenance but intentionally not part of the Go boot/codegen.🤖 Generated with Claude Code