AtlatestRepositorysigil-web-repl
1# sigil-web-repl
2
3A 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
7The REPL runs Sigil compiled to WebAssembly via Emscripten. It uses delimited continuations (prompts) to yield control back to JavaScript when waiting for user input:
8
91. `repl-start` begins the REPL and yields waiting for input
102. JavaScript collects input from the user
113. JavaScript calls back into WASM with `web-input-resume`
124. The saved continuation is invoked with the input
135. The REPL evaluates the expression and yields again for the next input
15## Requirements
17Building 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.
19## Dependencies
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 codes
26## Building
28Building requires the Emscripten SDK. On Guix systems, use the included helper script to set up an FHS container with emsdk:
30```bash
31# Enter an Emscripten shell (installs emsdk on first run, ~400MB)
32./scripts/emsdk-shell
34# Install dependencies and build inside the shell
35sigil deps install
36sigil build
37```
39Or run the build directly:
41```bash
42./scripts/emsdk-shell sigil deps install && ./scripts/emsdk-shell sigil build
43```
45This 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.
47## Usage
49Add as a dependency in your `package.sgl`:
51```scheme
52(from-git url: "codeberg:sigil/sigil-web-repl")
53```
55## License
57BSD-3-Clause