Run Clojure in your browser, evaluated by ClojureWasm
(cljw) — a from-scratch Clojure runtime in Zig, no JVM. Submissions are
evaluated in-process on the server's cljw under a per-submission budget
(steps / deadline / heap), and can call sandboxed WebAssembly modules written in
Rust and Go via cljw's Wasm FFI.
The Wasm FFI now runs JIT-compiled by default (cljw v1.0.0, embedding
zwasm v2.0.0): (wasm/load …) transparently rides zwasm's :auto
JIT-first engine, so a tight numeric loop inside a module executes as native machine
code — the engine-select and jit-speed examples show a ten-million-step loop
returning in a few milliseconds, byte-identical to the interpreter. The engine is a
runtime default; pass {:engine :interp} / {:engine :jit} to pick one explicitly.
- Frontend (
src/, ClojureScript + shadow-cljs) — a CodeMirror editor + a Wasm-module reference panel. The optimized release bundle is committed atresources/public/js/main.js. - Backend (
server/, ClojureWasm) —playground.serverserves the SPA and a/api/evalendpoint;playground.sandboxbounds each submission withcljw.eval/with-budget. Runs oncljw, no JVM, no Babashka. - Wasm modules (
modules/, hand-written Rust + Go) — exposed to evaluated code via(wasm/load …)/(wasm/run …). Origins inPROVENANCE.md.
./run_local.sh # builds cljw from source on first run, serves http://localhost:8080Deploy to fly.io (or any container host) — see DEPLOY.md. The repo
is self-contained: only cljw is built from source (Zig); the SPA and Wasm
modules are committed artifacts.
See the ClojureWasm project for runtime licensing. Demo sources here are provided as-is for illustration.