Update vendored kernel to Tarver's S41.2 (2026-07-11 refresh)#36
Merged
Conversation
Mark Tarver re-uploaded shenlanguage.org/Download/S41.2.zip on 2026-07-11
(sha256 51becbf…) with a RESTRUCTURED kernel under the same "41.2" version —
a different lineage from the community ShenOSKernel-41.2 shen-lua previously
vendored byte-identical. This rolls that refreshed kernel in.
Kernel proper (15 files, byte-identical to the zip's KLambda/):
yacc core load prolog reader sequent sys t-star toplevel track types
writer backend declarations macros
- NEW backend.kl (cl.* CL backend; booted, unused under Lua)
- REMOVED compiler.kl (shen-cl artifact, never used at runtime),
dict.kl (property vectors are now plain vectors; get/put index via
hash + shen.change-pointer-value), init.kl (initialisation moved to
load-time top-level forms in declarations.kl; there is no more
shen.initialise function).
Standard library + extensions retained byte-identical from community
ShenOSKernel-41.2 (Tarver's refresh ships stlib as lazy Shen sources under
Lib/StLib, which shen-lua does not yet load): stlib.kl + the 3 booted
extensions + the opt-in programmable-pattern-matching extension. They are pure
defuns referencing only public kernel functions, so they load unchanged.
Runtime adaptations:
- boot.lua: new 19-module FILES boot order (tail
…macros declarations t-star types — the refresh moved shen.rectify-type
into t-star and types.kl now runs 161 (declare …) forms at load, so t-star
must precede types); initialise() no longer requires shen.initialise (the
kernel self-initialises at load) but still calls it when present, so an
older kernel via SHEN_KL_DIR keeps working.
- lua_interop.lua: shen_register routes through update-lambda-table (the
refresh dropped shen.set-lambda-form-entry; the lambda table is now the
shen.*lambdatable* assoc list).
- typecheck_native.lua: harvest the 161 kernel signatures from types.kl's
(declare …) forms (init.kl's shen.initialise-signedfuncs is gone); falls
back to the init.kl harvest for pre-refresh kernels. Native fast path
stays active (161/161 harvested).
- repl.lua: "kernel loaded?" probe now checks `version`, not the removed
shen.initialise.
- build/make-bundle.lua: expect 20 vendored .kl (was 21).
Tests (LuaJIT 2.1): port specs 471/0 across 12 specs; canonical kernel
certification 134/134. See klambda/PROVENANCE.md for the full delta.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The refreshed kernel's canonical source is now the designated mirror pyrex41/shen-s41.1 (tag s41.2-pristine-20260711, commit 11fc51b), with the shenlanguage.org URL + zip sha256 kept as secondary origin detail. The 15 vendored kernel files are byte-identical to KLambda/ at that tag (verified with cmp). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 14, 2026
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
Mark Tarver re-uploaded
shenlanguage.org/Download/S41.2.zipon 2026-07-11 (Last-Modified; sha25651becbfd60fa8c93c3f8ae5b20b948eaa84c4b1d14ad2f5d2a056002a53ee836) with a restructured kernel under the same "41.2" version number — a different lineage from the communityShenOSKernel-41.2(shen-sourcestagshen-41.2) shen-lua had been vendoring byte-identical. This PR rolls the refreshed kernel in.(version)still reports"41.2".Full delta and dual-lineage provenance are documented in
klambda/PROVENANCE.md.Upstream delta (refresh vs community 41.2)
Kernel proper — 15 files, byte-identical to the zip's
KLambda/:yacc core load prolog reader sequent sys t-star toplevel track types writer backend declarations macrosbackend.kl— acl.*KLambda→Common-Lisp backend. On the upstream boot list; pure defuns, never called under Lua.compiler.kl— shen-cl's generated KL→Lisp compiler (a build artifact, never part of a ShenOSKernel release). shen-lua uses its owncompiler.lua; never referenced at runtime.dict.kl— property vectors are now plain vectors.*property-vector*is(vector 20000);get/putindex it viahash+shen.change-pointer-value/shen.remove-pointerinstead ofshen.dict/shen.<-dict/shen.dict->. Internal toget/put; callers unaffected.init.kl— folded intodeclarations.kl/toplevel.kl. There is no moreshen.initialisefunction: the kernel initialises itself at load time via top-level forms indeclarations.kl((set *property-vector* (vector 20000)), the envsets,(shen.initialise-arity-table …),(put shen shen.external-symbols …),(shen.build-lambda-table …)). Renames:hush→shen.hush,input+→shen.input-h+,shen.initialise-lambda-forms→shen.initialise-lambda-tables, droppedshen.set-lambda-form-entry.stlib.kl— upstream now ships the standard library as lazy Shen sources underLib/StLib/, not as precompiled KLambda.Standard library + extensions — retained byte-identical from community ShenOSKernel-41.2 (so the stdlib + CLI launcher stay available and certification holds):
stlib.kl,extension-features,extension-expand-dynamic,extension-launcher(booted),extension-programmable-pattern-matching(opt-in, not booted). All pure defuns/defmacros referencing only public kernel functions, so they load unchanged.What I did (runtime adaptations)
boot.lua— new 19-moduleFILESboot order. It is not upstreammake.shenorder (that relies on the factorise pass + a macros bootstrap that runs last); shen-lua compiles KLambda directly, so order is driven by load-time side effects. Tail is… macros declarations t-star types: the refresh movedshen.rectify-typeintot-star, andtypes.kl's 161(declare …)forms run the type checker at load, sot-starmust precedetypes, and bothmacros(forshen.prolog-vector) anddeclarations(forshen.*sigf*+ the arity table) must precedetypes.initialise()no longer requiresshen.initialise, but still calls it when present (older kernels viaSHEN_KL_DIRkeep working).lua_interop.lua—shen_registernow routes through the kernel's ownupdate-lambda-table(put arity + cons(shen.lambda-entry name)ontoshen.*lambdatable*), sinceshen.set-lambda-form-entryis gone. The refresh'sshen.lambda-entrystores the curried function, so the old tc+ "apply a non-function" hazard the previous code worked around no longer exists.typecheck_native.lua— the 161 native kernel signatures are now harvested fromtypes.kl's(declare NAME TYPE)forms (the same rcons trees the existingevalrconsdecodes);init.kl'sshen.initialise-signedfuncsis gone. Falls back to theinit.klharvest for pre-refresh kernels. Native typecheck fast path stays active: 161/161 signatures harvested.repl.lua— "kernel loaded?" probe now checksversion(wasshen.initialise, which the refresh removed — would have forced a kernel reload on every REPL start).build/make-bundle.lua— expect 20 vendored.kl(was 21). Single-file bundle rebuilt and boots standalone.Test status (LuaJIT 2.1)
make test)make certify)(version)→ 41.2)Remaining work / follow-ups (not blocking)
Lib/StLibloader. The clean end state is to load the refresh's Shen-source standard library on demand instead of vendoring the communitystlib.kl. Blocked on a source-loader; not attempted here.arityproperty is-1(becausestlib.initialiseis never called), so a bare(fn filter)/ top-level(filter …)through the lambda table fails with "fn: filter is undefined". Verified identical on the pre-refresh kernel. The lazy loader above fixes this too.bin/shenfallback branch callsshen.initialise_environment(removed, and already a no-such-symbol name pre-refresh). Dead code — only reached ifrequire("repl")fails, which it does not. Left as-is; flagged for a future cleanup.bin/ratatoskr-build.luareferencesshen.initialisein a comment describing its generated manifest's init step. The ratatoskr build path is out of scope here (separate tracked task) and will need its manifest updated for the load-time-init model.Note for sibling Shen ports
The load-time-init restructuring is the headline for any port that tracks this kernel: there is no
shen.initialiseto call post-load — initialisation is top-level forms indeclarations.kl, so a port's boot driver must stop callingshen.initialiseand must loaddeclarationsaftersysand beforetypes, withmacros+t-staralso beforetypes. Ports with a native/precomputed signature table should re-source it fromtypes.kl's(declare …)forms. Ports that assumed ashen.dictproperty vector must accept a plain(vector 20000).🤖 Generated with Claude Code