Web playground
対象実装: このドキュメントは現行 Web Playground(Bootstrap 実装)について記述する。NEPLg2.1 の正の仕様は
doc/2.1spec/を参照。
The web playground lives under web/ and is built by Trunk (Trunk.toml targetsweb/index.html).
Local development
- Run
trunk serveand openhttp://127.0.0.1:8080/. - The embedded editor is optional. If
web/vendor/editorsampleis missing, the fallback textarea is used. - GitHub Pages builds pass
--public-url /NEPL-g2/so the published site resolves assets under that prefix. - If you set
--public-urlto a subpath (e.g./web/dist/),trunk servewill also expect that base path. Openhttp://127.0.0.1:8080/web/dist/or pass--serve-base / --ws-base /to serve from root while keeping asset URLs under the subpath.
Terminal features
The embedded terminal can:
run: compile the current editor source to WASM and execute it in the browser.test: compile and execute stdlib tests (fromstdlib/tests).clear: clear terminal output.
WAT generation is provided by the "WATを生成" button in the editor panel.
Standard input is provided via the terminal stdin textarea. Output is captured
from WASI fd_write and rendered in the terminal pane.
Notes
- The compiler runs in WebAssembly and uses an in-memory stdlib source map.
- Diagnostics are rendered as text with line/column information.
- The terminal is a browser-only convenience; it does not execute
cargocommands. - Only stdlib imports are available in the browser; local file imports are not supported yet.