1
0
Fork
You've already forked sigil-web-repl
0
Interactive Sigil REPL for the web — WASM-compiled backend for browser-based development
  • HTML 95%
  • Shell 5%
Find a file
David Wilson 82f1801283 Load optional WASM bridge imports
Teach the web REPL host page to load sigil-wasm-bridges.js when present, create bridge import objects before instantiation, and attach the instance after instantiation.
When no bridge manifest is emitted, provide no-op sigil_wasm_net imports so strict Zig/WASI runtime builds still instantiate.
Verification: SIGIL_REDIRECTS=dev-redirects.sgl ../sigil/build/dev/bin/sigil build --config web --force --no-bundle; final WASM imports sigil_wasm_net.*.
2026年05月06日 14:31:50 +03:00
assets Load optional WASM bridge imports 2026年05月06日 14:31:50 +03:00
scripts Convert to standalone package 2026年03月31日 11:34:02 +03:00
src Use sigil-wasm-runtime in web REPL 2026年05月06日 11:41:22 +03:00
.gitignore Ignore Sigil dependency state 2026年05月06日 11:48:13 +03:00
CHANGELOG.md Release: version bumps 2026年01月09日 17:17:43 +02:00
dev-redirects.sgl Use sigil-wasm-runtime in web REPL 2026年05月06日 11:41:22 +03:00
package.sgl Use sigil-wasm-runtime in web REPL 2026年05月06日 11:41:22 +03:00
README.md Use sigil-wasm-runtime in web REPL 2026年05月06日 11:41:22 +03:00
sigil.lock Migrate to 0.9.1 transitive deps with version ranges 2026年04月01日 13:25:25 +03:00

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:

  1. repl-start begins the REPL and yields waiting for input
  2. JavaScript collects input from the user
  3. JavaScript calls back into WASM with web-input-resume
  4. The saved continuation is invoked with the input
  5. 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 library
  • sigil-repl - REPL commands
  • sigil-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 build

Or run the build directly:

./scripts/emsdk-shell sigil deps install && ./scripts/emsdk-shell sigil build

This 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