Live demo · Lua on WASM
Lua playground
This is Lua 5.4 compiled to WebAssembly, running in your browser. Edit the code and run it. The presets are the real modules behind /counter and /todos; how the runtime works is on /work/web.
pages/counter.lua · Unmodified
Tab indents · Esc then Tab leaves the editor
Preview
Loading the engine…
Console
A fresh engine per run
Every Run closes the previous Lua state and boots a new one with h.lua and reactive.lua already mounted, so require works as it does on the site.
Loops are stopped
A debug.sethook count hook stops top-level code after 20 million instructions; click handlers get 1.5 s each. Try while true do end.
The same bridge
dom.mount(root, "#app") lands in the preview pane, so the counter and todo modules run here unmodified. The runner is pages/playground.lua.