Some sample WebAssembly Text programs.
WebAssembly defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating interactions between such programs and their host environment.
The text format (WAT) is, essentially, an assembly language. While most people will not write WAT directly (just as most programmers don't write assembly code directly), familiarity this format is important if you seek a deep understanding of WASM mechanisms and related toolchains.
Unless otherwise stated, each sample consists of a single .wat file and an
accompanying test.js file. When the setup is more complicated, the directory's
own README will have additional information.
First, start by compiling the WAT file to WASM with wabt or some other WASM toolchain:
$ wat2wasm somefile.wat
This creates a somefile.wasm binary, which test.js expects to find in its
own directory. To load and test the WASM, you'll need a recent
Node.js installed, and run:
$ node test.js
This will typically emit some output; if the loading failed or the loaded WASM
behaves unexpectedly, the test.js script will report an error.
Useful sources of documentation about WASI host calls:
- Preview 1 ABI
- wasi-libc sources; in particular, the wasi/api.h header


Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
