From efee584bf5d40f7c3ebda8642bb4a9000603e4a2 Mon Sep 17 00:00:00 2001 From: Reuben Brooks Date: Fri, 19 Jun 2026 19:07:50 -0500 Subject: [PATCH] shake: add the swift target (shen-swift) to the shake mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit shen-swift is now a Ratatoskr stage-2 target, so map the `swift` build target onto its `shen-swift` impl column. With this, `--shake` covers all eight bifrost ports — no column shows `----` for a missing builder. Unlike the compiled targets, shen-swift is a tree-walking interpreter: its artifact drives the interpreter on the shaken slice in `--shaken` mode (a ~200-line kernel vs the full ~2500-line kernel), the same runtime-reference relationship lua/julia have to their toolchains. Co-Authored-By: Claude Opus 4.8 --- README.md | 10 ++++++---- bifrost.py | 8 +++++--- shake.go | 10 ++++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cd9cc41..df49bdd 100644 --- a/README.md +++ b/README.md @@ -151,16 +151,18 @@ python3 bifrost.py --shake --impls shen-lua,ShenScript # just the fast ones Artifacts map onto their impl column (lisp→`shen-cl`, lua→`shen-lua`, go→`shen-go`, rust→`shen-rust`, js→`ShenScript`, julia→`shen-julia`, -scheme→`shen-scheme`); `shen-swift` has no Ratatoskr builder yet and shows -`----`. Needs the per-target toolchains -(`sbcl`/`luajit`/`go`/`cargo`/`node`/`julia`/`chez`) and +scheme→`shen-scheme`, swift→`shen-swift`) — all eight ports now have a +Ratatoskr builder. Needs the per-target toolchains +(`sbcl`/`luajit`/`go`/`cargo`/`node`/`julia`/`chez`/`swift`) and `$BIFROST_RATATOSKR_DIR` (default `../ratatoskr`); missing toolchains are skipped, not failed. This mode is minutes, not seconds: go/rust compile from scratch, and the **julia** target AOT-bakes a per-program sysimage (PackageCompiler, ~250MB, several minutes) — the deploy artifact for Shen-on-Julia, analogous to the Lisp saved image. The **scheme** target compiles the shaken slice with shen-scheme's own `kl->scheme` into a -self-contained Chez program. +self-contained Chez program; the **swift** target drives the shen-swift +tree-walking interpreter on the shaken slice in `--shaken` mode (booting a +~200-line kernel instead of the full ~2500-line kernel). `--shake` drives the **Go `ratatoskr` binary** (resolved on `$PATH`, else `$RATATOSKR_BIN`, else `$BIFROST_RATATOSKR_DIR` / a sibling `../ratatoskr`); no diff --git a/bifrost.py b/bifrost.py index f7d53c5..b802ef0 100644 --- a/bifrost.py +++ b/bifrost.py @@ -857,8 +857,8 @@ def run_ratatoskr_parity(case, available): # -------------------------------------------------------------------------- # Each Ratatoskr build target maps onto the impl column it runs on, so shake -# results line up with the normal matrix. shen-swift has no Ratatoskr builder -# yet, so it stays absent and shows SKIP in its column. +# results line up with the normal matrix. All eight bifrost ports now have a +# Ratatoskr builder. # # The `julia` target is special: shen-julia's stand-alone artifact is produced # by AOT-compiling the shaken kernel+user KL into baked Julia methods and (per @@ -867,9 +867,11 @@ def run_ratatoskr_parity(case, available): # minutes and ~250MB, so it only runs under --shake (already opt-in/heavy). # The `scheme` target compiles the shaken slice with shen-scheme's own # kl->scheme into a self-contained Chez artifact (run via `chez --script`). +# The `swift` target drives the shen-swift tree-walking interpreter on the +# shaken slice (boot a ~200-line kernel instead of the full ~2500-line kernel). TARGET_TO_IMPL = {"lisp": "shen-cl", "lua": "shen-lua", "go": "shen-go", "rust": "shen-rust", "js": "ShenScript", "julia": "shen-julia", - "scheme": "shen-scheme"} + "scheme": "shen-scheme", "swift": "shen-swift"} def _import_ratatoskr_cli(): diff --git a/shake.go b/shake.go index 2b58b81..4e9606a 100644 --- a/shake.go +++ b/shake.go @@ -15,19 +15,21 @@ import ( ) // Each Ratatoskr build target maps onto the impl column it runs on, so shake -// results line up with the normal matrix. shen-swift has no Ratatoskr builder -// yet, so it is absent and shows SKIP. +// results line up with the normal matrix. All eight bifrost ports now have a +// Ratatoskr builder. // // The `julia` target is special: shen-julia's stand-alone artifact AOT-compiles // the shaken kernel+user KL into baked Julia methods and (per builders.json) // bakes a per-program sysimage via PackageCompiler — the Julia analogue of the // Lisp saved image / Go-Rust native binary. That bake costs minutes, so the // shake timeout below is generous. The `scheme` target compiles the shaken slice -// with shen-scheme's own kl->scheme into a self-contained Chez artifact. +// with shen-scheme's own kl->scheme into a self-contained Chez artifact; the +// `swift` target drives the shen-swift tree-walking interpreter on the slice +// (boot a ~200-line shaken kernel instead of the full ~2500-line kernel). var targetToImpl = map[string]string{ "lisp": "shen-cl", "lua": "shen-lua", "go": "shen-go", "rust": "shen-rust", "js": "ShenScript", "julia": "shen-julia", - "scheme": "shen-scheme", + "scheme": "shen-scheme", "swift": "shen-swift", } const shakeTargetTimeout = 20 * time.Minute // accommodates the julia sysimage bake