Commit562df5f2Recorded6 May 2026Repositorysigil-web-repl
Use sigil-wasm-runtime in web REPL
Message
Update sigil-web-repl to depend on sigil-wasm-runtime, export and call the sigilwasm* runtime ABI, and use the renamed SIGIL_WASM build define.
Also move stale sigil-repl and sigil-ansi declarations to their standalone repos and add local redirects for the standalone dependencies used by the redirected web build.
Verification:
- sigil deps check --redirects dev-redirects.sgl
- SIGIL_REDIRECTS=dev-redirects.sgl sigil build --config web
Changed
README.md | 6 +++---
assets/index.html | 6 +++---
dev-redirects.sgl | 12 ++++++++++++
package.sgl | 19 ++++++++++---------
src/main.sgl | 2 +-
src/sigil/web-repl.sgl | 2 +-
6 files changed, 30 insertions(+), 17 deletions(-)Diff
README.mdmodified
@@ -1,6 +1,6 @@
1
# sigil-web-repl 2
−3
A web-based REPL for trying [Sigil](https://codeberg.org/sigil/sigil) in the browser. Uses `sigil-web-run` as the WebAssembly runtime and delimited continuations for interactive input/output between JavaScript and Sigil.+3
A web-based REPL for trying [Sigil](https://codeberg.org/sigil/sigil) in the browser. Uses `sigil-wasm-runtime` as the WebAssembly runtime and delimited continuations for interactive input/output between JavaScript and Sigil. 4
5
## How it works 6
@@ -14,11 +14,11 @@ The REPL runs Sigil compiled to WebAssembly via Emscripten. It uses delimited co
14
15
## Requirements 16
−17
Building this package requires [Emscripten](https://emscripten.org/) and the `sigil-web-run` C runtime. This is not a standard Sigil package build; it produces `.js` and `.wasm` output files for browser deployment.+17
Building this package requires [Emscripten](https://emscripten.org/) and the `sigil-wasm-runtime` C runtime. This is not a standard Sigil package build; it produces `.js` and `.wasm` output files for browser deployment. 18
19
## Dependencies 20
−21
- `sigil-web-run` - WebAssembly C runtime (from sigil monorepo)+21
- `sigil-wasm-runtime` - WebAssembly C runtime (from sigil monorepo) 22
- `sigil-stdlib` - Standard library 23
- `sigil-repl` - REPL commands 24
- `sigil-ansi` - Terminal color codesassets/index.htmlmodified
@@ -1209,7 +1209,7 @@
1209
])), 1210
]; 1211
−1212
const wasi = new WASI(["sigil-web"], [], fds, { debug: false });+1212
const wasi = new WASI(["sigil-web-repl"], [], fds, { debug: false }); 1213
1214
try { 1215
const wasmModule = await WebAssembly.compileStreaming(fetch('sigil-web-repl.wasm'));@@ -1217,8 +1217,8 @@
1217
wasi_snapshot_preview1: wasi.wasiImport, 1218
}); 1219
−1220
sigilInput = (str) => callWithString(instance, instance.exports.sigil_web_input, str);−1221
sigilEval = (str) => callWithString(instance, instance.exports.sigil_web_eval, str);+1220
sigilInput = (str) => callWithString(instance, instance.exports.sigil_wasm_input, str);+1221
sigilEval = (str) => callWithString(instance, instance.exports.sigil_wasm_eval, str); 1222
1223
// Start the VM 1224
wasi.start(instance);dev-redirects.sglmodified
@@ -4,6 +4,18 @@
4
(for-repo 5
url: "codeberg:sigil/sigil" 6
use: (from-path dir: "../sigil"))+7
(for-repo+8
url: "codeberg:sigil/sigil-repl"+9
use: (from-path dir: "../sigil-repl"))+10
(for-repo+11
url: "codeberg:sigil/sigil-ansi"+12
use: (from-path dir: "../sigil-ansi"))+13
(for-repo+14
url: "codeberg:sigil/sigil-hooks"+15
use: (from-path dir: "../sigil-hooks"))+16
(for-repo+17
url: "codeberg:sigil/sigil-docs"+18
use: (from-path dir: "../sigil-docs")) 19
(for-repo 20
url: "codeberg:sigil/sigil-sxml" 21
use: (from-path dir: "../sigil-sxml"))package.sglmodified
@@ -1,12 +1,13 @@
1
;;; sigil-web-repl - Interactive Sigil REPL for the web 2
;;; 3
;;; A web-based REPL and code editor for trying Sigil in the browser.−4
;;; Uses sigil-web-run as the runtime and delimited continuations for+4
;;; Uses sigil-wasm-runtime as the runtime and delimited continuations for 5
;;; interactive input/output. 6
7
(package 8
name: "sigil-web-repl" 9
version: "0.7.0"+10
sigil: "^0.15" 11
description: "Interactive Sigil web REPL" 12
url: "https://codeberg.org/sigil/sigil-web-repl" 13
license: "BSD-3-Clause"@@ -31,21 +32,21 @@
32
target: "wasm32-wasi" 33
debug?: #f 34
optimize: 2−34
c-flags: (with-sigil-c-flags '("-std=c99" "-D_GNU_SOURCE" "-D__SIGIL_WEB__" "-Wall" "-O2"))−35
link-flags: '("-Wl,--export=sigil_web_init"−36
"-Wl,--export=sigil_web_start"−37
"-Wl,--export=sigil_web_eval"−38
"-Wl,--export=sigil_web_input"+35
c-flags: (with-sigil-c-flags '("-std=c99" "-D_GNU_SOURCE" "-D__SIGIL_WASM__" "-Wall" "-O2"))+36
link-flags: '("-Wl,--export=sigil_wasm_init"+37
"-Wl,--export=sigil_wasm_start"+38
"-Wl,--export=sigil_wasm_eval"+39
"-Wl,--export=sigil_wasm_input" 40
"-Wl,--export=malloc" 41
"-Wl,--export=free" 42
"-lc") 43
features: '(web wasm))) 44
45
dependencies: (list−45
(from-git url: "codeberg:sigil/sigil" package: "sigil-web-run" version: "^0.9.0")+46
(from-git url: "codeberg:sigil/sigil" package: "sigil-wasm-runtime" version: "^0.9.0") 47
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.9.0")−47
(from-git url: "codeberg:sigil/sigil" package: "sigil-repl" version: "^0.9.0")−48
(from-git url: "codeberg:sigil/sigil" package: "sigil-ansi" version: "^0.9.0"))+48
(from-git url: "codeberg:sigil/sigil-repl" version: "^0.14.1")+49
(from-git url: "codeberg:sigil/sigil-ansi" version: "^0.14.0")) 50
51
tasks: (list 52
(tasksrc/main.sglmodified
@@ -1,6 +1,6 @@
1
;;; Sigil Web REPL - Main entrypoint 2
;;;−3
;;; This is loaded by sigil-web-run at startup.+3
;;; This is loaded by sigil-wasm-runtime at startup. 4
;;; It imports and starts the web REPL. 5
6
(import (sigil web-repl))src/sigil/web-repl.sglmodified
@@ -210,6 +210,6 @@
210
(lambda () 211
(k input)))))) 212
−213
;; Entry point for web runtime+213
;; Entry point for WASM runtime 214
(define (main) 215
(repl-start))))