Portable compiler sources that compile to both JavaScript using tsc and WebAssembly using toilscript.
import toilscript from "toilscript";
...To build the compiler, run:
npm run buildThe rebuild automatically when there are changes, do:
npm run watchTo build the compiler to a WebAssembly binary, run:
npm run bootstrapUses the ToilScript compiler compiled to JavaScript to compile itself to WebAssembly, building to WebAssembly again using itself compiled to WebAssembly. Builds to build/. Performs a git diff to make sure that both the initial and the final artifacts are the same. Note that this builds the compiler as a library, while the toilscript frontend setting it up and feeding it source files is JavaScript for now.
Running toilscript with the WebAssembly variant:
toilscript [options...] --wasm build/toilscript.release-bootstrap.jsRunning the compiler tests with the WebAssembly variant:
npm run test:compiler -- --wasm build/toilscript.release-bootstrap.js