Playground
The BioLang Playground lets you write and run BioLang code directly in your browser using WebAssembly. No installation, no server — just open the page and start coding.
Features
- Persistent state between runs — variables and functions carry over
- Block numbering and "Run All Above + This" for multi-block scripts
- Inline SVG chart rendering from
bar_chart(),scatter(),histogram(), etc. - Syntax highlighting with BioLang-aware tokenizer
- Dark/light theme toggle
How It Works
- The playground compiles BioLang to WebAssembly via the
br-wasmcrate - Each code block runs in a shared interpreter instance (thread-local)
- Output is captured as JSON:
{ ok, value, type, output, error } - SVG output is rendered inline with white background
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl + Enter | Run current block |
| Shift + Ctrl + Enter | Run all above + this |
Limitations
- File I/O reads via synchronous XHR (
__blFetch.sync) — works for URLs only - No filesystem access (use the REPL for local files)
- Single-threaded — no parallel execution
- ~50MB WASM binary download on first visit (cached by service worker)