A toy language that compiles to WebAssembly binary format, written in TypeScript.
Wats uses a simple syntax with functions declared using funk:
funk add(x, y) { x + y }
funk main() {
let result = add(1, 2);
result
}
Supports arithmetic (+, -, *, /), let bindings, variable assignment (:=), and function calls.
# Run the REPL
npm run repl
# Run tests
bun test
# Type check
npm run checksrc/wasm/— Low-level WebAssembly binary encoding (LEB128, instructions, sections, module builder)src/compiler/— Language frontend: Ohm.js PEG grammar, semantic actions, and compilersrc/runtime/— WebAssembly module loadertest/— Tests (mirrorssrc/structure)