Skip to content

3p3r/catala-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

catala-wasm

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.

Build

Requires Node.js, npm, Rust (for the tree-sitter CLI), and OCaml with opam. The build script:

  1. Clones tree-sitter-catala, builds WASM parsers for en/fr/pl, and adds the tree-sitter playground UI to dist/.
  2. Clones the Catala compiler repo, runs make dependencies-js and make web-interpreter-tests, then copies the web interpreter and writes dist/compiler.html.
npm install
npm run build

Output is in dist/ (parser + compiler, ready to serve or deploy).

Demo

Serve dist/ locally:

npm run serve

Open the URL (e.g. http://localhost:8080): use the parser page for the AST view and the Compiler link for typecheck/interpret.

Deploy

Deploy the contents of dist/ to any static host (e.g. GitHub Pages). No server-side logic required.

About

catala language parser and compiler in webassembly/js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors