Demo of compiling a Halide pipeline to wasm and calling the pipeline as a function in JavaScript.
Install emscripten. See instructions here.
Clone and build my fork of the Halide library and LLVM. Instructions for building both are in the README for the Halide repository.
Set the variables listed at the top of setup.sh to point to the dependencies (which were described above).
Activate emscripten tools (so that emcc is available).
Then, run:
source setup.sh
make
npm install
npm start
Open the index page in a browser.
Open the browser console to see more output.