Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.claude/
.shen-kernel-cache*.bin
.shen-kernel-cache*.bin.tmp
.shen-kernel-cache*.bin.stlib
.shen-kernel-cache*.bin.stlib.tmp
build/shen-bundle.lua
.fasl-test/
luacov.stats.out
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Changelog

Notable changes to shen-lua. Release notes for earlier versions are under
[`doc/`](doc/) (`RELEASE-*.md`).

## [Unreleased]

### Changed

- **Kernel: ShenOSKernel 42.2** (community `Shen-Language/shen-sources`, tag
`shen-42.2`, commit `73507e0`, release tarball SHA-256 `1d022730…2678d8`),
vendored byte-identical, replacing Tarver's S42.0 kernel — the same kernel
shen-scheme 0.50 ships. `(version)` is `"42.2"`. Lineage choice and full
delta: [`klambda/PROVENANCE.md`](klambda/PROVENANCE.md) (pyrex41/shen-lua#79).
- Boot: the 42.2 modules are pure defuns; `boot.lua` now calls
`(shen.initialise)`, `(shen.x.features.initialise …)`,
`(shen.x.programmable-pattern-matching.initialise)` and `(stlib.initialise)`
after loading them, matching shen-scheme 0.50's boot set and order.
- Standard library: the precompiled 42.2 `klambda/stlib.kl` replaces the
S-lineage `lib/StLib` Shen sources (removed, together with the stdlib boot
image that cached loading them). Its 290 type signatures are cached in a
sidecar of the kernel bytecode cache (`<kernel cache>.stlib`). Warm boot is
~100 ms CPU (was ~135 ms).
- `prims.lua`: the native `get`/`put`/`unput`/`arity` property store now
operates on the 42.2 `shen.dict` layout; the native `fn` cache is
invalidated on every `shen.lambda-form` write (42.0 port requirement).
`shen.lambda-entry` is native from boot.
- The kernel test suite under `tests/` is the 42.2 suite (143 tests, was 134);
the 42.2 extension suite (`tests/extensions/runme.shen`, 123 checks) passes
when run from a ShenOSKernel 42.2 tree.
- `shen.*prolog-memory*` defaults to 10000 (42.2 `init.kl`; S42 had 1000).
- `bin/yggdrasil-build.lua` expects `kernel-version=42.2` manifests (older
slices still build, with a warning).

### Fixed

- `<-address` past the end of an absvector raises instead of returning `nil`,
so the kernel's vector printer stops at the end: `(vector 3)` prints
`<... ... ...>` (it printed stray `funex…` entries).
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# shen-lua

[Shen](https://shenlanguage.org) on **LuaJIT 2.1**: pattern matching, optional
sequent types, and Prolog, compiled to Lua. Shen 42, **134/134** official
kernel tests. Embeds in any Lua host. Plain Lua 5.1/5.4/5.5 works too (slower,
sequent types, and Prolog, compiled to Lua. ShenOSKernel 42.2, **143/143**
official kernel tests. Embeds in any Lua host. Plain Lua 5.1/5.4/5.5 works too (slower,
still correct).

```sh
Expand All @@ -15,8 +15,9 @@ luajit examples/hello_embed.lua # embed in Lua, ~25 lines

LuaJIT 2.1 is the primary host (`brew install luajit` /
`apt-get install luajit`); the source checkout also supports plain Lua as
described below. First boot compiles the kernel and loads the Shen-source
standard library; subsequent boots use bytecode and standard-library caches.
described below. First boot compiles the kernel (including the precompiled
standard library, `stlib.kl`); subsequent boots use the bytecode and
standard-library signature caches.
Loaded programs are cached fasl-style. Cross-port agreement lives in
[Bifrost](https://github.com/pyrex41/bifrost). New to Shen?
[shenlanguage.org](https://shenlanguage.org).
Expand Down Expand Up @@ -124,7 +125,7 @@ More under [`examples/`](examples/README.md). A full tour:

```sh
make test # port specs (test/*_spec.lua)
luajit run-kernel-tests.lua # official 42 suite → 134/134
luajit run-kernel-tests.lua # official 42.2 suite → 143/143
```

The kernel suite is vendored in `tests/`. Port specs cover primitives, REPL,
Expand All @@ -137,8 +138,8 @@ luarocks install shen # launcher + modules
luarocks make --local shen-scm-1.rockspec # this tree
```

LuaJIT required (`lua == 5.1`). Release **0.11.1** uses kernel **42**; **0.9.0**
was 41.1. Or grab `shen-bundle.lua` from
LuaJIT required (`lua == 5.1`). This tree uses ShenOSKernel **42.2**; release
**0.11.1** uses Tarver's S42 kernel; **0.9.0** was 41.1. Or grab `shen-bundle.lua` from
[Releases](https://github.com/pyrex41/shen-lua/releases/latest) — one file,
`require("shen-bundle")`.

Expand Down Expand Up @@ -168,7 +169,7 @@ LuaJIT trace logs, run `luajit -jv bin/shen ...`.

Prolog and the typechecker run on a native engine (`prolog_engine.lua`); the
portable kernel predicates that show up on compile and execution paths are
overridden in `prims.lua`. Caches (kernel bytecode, stdlib image, user fasl)
overridden in `prims.lua`. Caches (kernel bytecode, stdlib signatures, user fasl)
are content-keyed and safe to delete. Internals:
[`doc/PERF-HANDOFF.md`](doc/PERF-HANDOFF.md),
[`doc/BENCHMARKS.md`](doc/BENCHMARKS.md).
Expand All @@ -179,7 +180,7 @@ LuaJIT 2.1. Kernel sources are in `klambda/` (see
[`klambda/PROVENANCE.md`](klambda/PROVENANCE.md)). `SHEN_KL_DIR` can point at
another tree.

**PUC Lua 5.1/5.4/5.5:** same 134/134. No FFI → legacy Prolog engine; no `bit`
**PUC Lua 5.1/5.4/5.5:** same 143/143 (checked on 5.4.7). No FFI → legacy Prolog engine; no `bit`
→ caches off. Lua 5.3+ arithmetic is forced to floats so it matches LuaJIT.

**Old LuaJIT on aarch64** (2.1.0-beta3): boot-time JIT crash, fixed upstream.
Expand Down
6 changes: 3 additions & 3 deletions bin/yggdrasil-build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- luajit bin/yggdrasil-build.lua <shaken-dir> <out.lua> [--linked]
--
-- <shaken-dir> is a Yggdrasil stage-1 output directory: a tree-shaken
-- kernel (kernel.kl, ShenOSKernel-42 defuns in load order), the user
-- kernel (kernel.kl, ShenOSKernel defuns in load order), the user
-- program as KL (one or more user= files), and yggdrasil.manifest.txt.
-- The builder compiles every KL form ahead of time with the port's own
-- compiler (compiler.lua C.compile_top) and emits ONE runnable Lua
Expand Down Expand Up @@ -108,8 +108,8 @@ end
assert(man.kernel, MANIFEST .. ": missing kernel=")
assert(man.init, MANIFEST .. ": missing init=")
assert(#man.user > 0, MANIFEST .. ": no user= entries")
if man["kernel-version"] ~= "42" then
io.stderr:write(("yggdrasil-build: warning: manifest kernel-version=%s, this port is certified against 42\n")
if man["kernel-version"] ~= "42.2" then
io.stderr:write(("yggdrasil-build: warning: manifest kernel-version=%s, this port is certified against 42.2\n")
:format(tostring(man["kernel-version"])))
end

Expand Down
Loading
Loading