LANGUAGES ON WASM
Ruby.wasm Playground
A real CRuby 3.4 running on WebAssembly inside a Worker — write Ruby, run it, draw on the page, and poke at the WASI internals. Nothing leaves your browser.
Runs 100% client-side
00 · BOOT
VM boot
Waiting
00 · BOOT
VM boot
- Download runtime (gzip)
- Compile wasm module
- Instantiate VM
- Load playground prelude
- Ready
Editor
Ruby stage
Stage — page toys draw & listen here
Session log
Boot the VM to start a session.
03 · UNDER THE HOOD
ruby.wasm feature matrix
Each check runs inside the live VM. Limits documented by ruby.wasm (threads, native sockets) are expected to fail — that is the finding, not a bug.
04 · WASI FILESYSTEM
Virtual filesystem
The WASI preopen mounted at /. Files Ruby writes appear here; write a file
and File.read it back from Ruby.
- Boot the VM first.
Select a file to view it.
05 · NOTES
What this proves
-
The 30.6 MB stdlib build ships as an 8.9 MB gzip file and is inflated in-page with
DecompressionStream, staying under the Cloudflare Pages 25 MiB file limit. - Ruby runs in a dedicated Worker, so an infinite loop never freezes this tab — the Kill button terminates and reboots the VM.
-
JS.globalinside a Worker cannot see the DOM, so page toys are reached through a postMessage bridge (Dom/Canvashelpers in prelude.rb). Event handlers registered by Ruby keep working between runs. -
evalAsyncuses Asyncify, soJS::Object#awaitworks on every engine — no JSPI flag needed.