sigil-web-repl / treeREADME.md
sigil-web-repl
A web-based REPL for trying Sigil in the browser. Uses sigil-wasm-runtime as the WebAssembly runtime and delimited continuations for interactive input/output between JavaScript and Sigil.
How it works
The REPL runs Sigil compiled to WebAssembly via Emscripten. It uses delimited continuations (prompts) to yield control back to JavaScript when waiting for user input:
repl-startbegins the REPL and yields waiting for input- JavaScript collects input from the user
- JavaScript calls back into WASM with
web-input-resume - The saved continuation is invoked with the input
- The REPL evaluates the expression and yields again for the next input
Requirements
Building this package requires Emscripten 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.
Dependencies
sigil-wasm-runtime- WebAssembly C runtime (from sigil monorepo)sigil-stdlib- Standard librarysigil-repl- REPL commandssigil-ansi- Terminal color codes
Building
Building requires the Emscripten SDK. On Guix systems, use the included helper script to set up an FHS container with emsdk:
# Enter an Emscripten shell (installs emsdk on first run, ~400MB)
./scripts/emsdk-shell
# Install dependencies and build inside the shell
sigil deps install
sigil buildOr run the build directly:
./scripts/emsdk-shell sigil deps install && ./scripts/emsdk-shell sigil buildThis compiles the Sigil modules, links them into a web application (sigil-web-repl.js and sigil-web-repl.wasm), and copies the HTML assets to the output directory.
Usage
Add as a dependency in your package.sgl:
(from-git url: "codeberg:sigil/sigil-web-repl")License
BSD-3-Clause