Run it in your browser

The samples run right here, in this page. They are the WebAssembly modules that ./build.sh --wasm makes and that the tests check, built from this site's version of the code: a few dozen kilobytes each, and 1.1 MB for the language model, whose weights are inside it.

Pick a sample and run it

Each sample runs as soon as you pick it: the terminal shows the command and what the program prints, and the program's source is below it. Change the arguments or the input and run it again.

Standard input
samples/

What the page does

The page gives each program what a terminal would: its arguments, standard input from the box, and standard output and error printed below, with the exit code. That is all of WASI these programs use, so the page implements it itself, in docs/content/run-wasm.js, instead of loading a library.

The programs run as they do under wasmtime, on one thread: WebAssembly here has no threads, so Parallel.For runs its loop on the calling thread. Run it on WebAssembly shows how to build and run the same modules yourself.