Catala in the browser: a static web app with a parser playground (tree-sitter AST) and a compiler (typecheck and interpret), built from tree-sitter-catala and the Catala compiler.
Live demo: https://3p3r.github.io/catala-wasm/
- Parser playground (/) — Edit Catala (en/fr/pl) and see the tree-sitter AST. Built with tree-sitter and WASM parsers.
- Compiler (/compiler.html) — Typecheck and interpret Catala in the browser via the official compiler’s js_of_ocaml web interpreter.
One build produces everything in dist/; deploy that folder to any static host.
Requires Node.js, npm, Rust (for the tree-sitter CLI), and OCaml with opam. The build script:
- Clones tree-sitter-catala, builds WASM parsers for en/fr/pl, and adds the tree-sitter playground UI to
dist/. - Clones the Catala compiler repo, runs
make dependencies-jsandmake web-interpreter-tests, then copies the web interpreter and writesdist/compiler.html.
npm install
npm run buildOutput is in dist/ (parser + compiler, ready to serve or deploy).
Serve dist/ locally:
npm run serveOpen the URL (e.g. http://localhost:8080): use the parser page for the AST view and the Compiler link for typecheck/interpret.
Deploy the contents of dist/ to any static host (e.g. GitHub Pages). No server-side logic required.