Binary builds of WAVM are available on GitHub releases for Windows, Linux, and macOS.
Download wavm-windows-x64.zip and extract it anywhere in your filesystem. Add the bin directory to your PATH environment variable to use wavm from any directory.
Linux builds are available as .deb packages, .rpm packages, or .tar.gz archives.
Debian/Ubuntu (deb):
sudo apt install ./wavm-{version}-linux.deb
# To remove: sudo apt remove wavmFedora/RHEL/AlmaLinux (rpm):
sudo dnf install ./wavm-{version}-linux.rpm
# To remove: sudo dnf remove wavmOther distributions (tar.gz):
mkdir wavm && tar -xzf wavm-{version}-linux.tar.gz -C wavmThe Linux binaries are built on a manylinux_2_28 (AlmaLinux 8) base and should work on most modern glibc-based Linux distributions, including:
- Ubuntu 20.04+
- Debian 11+
- Fedora 40+
- AlmaLinux/Rocky Linux 8+
- openSUSE Leap 15.6+
Download wavm-macos-arm64.tar.gz and extract it:
mkdir wavm && tar -xzf wavm-macos-arm64.tar.gz -C wavmNote: macOS builds are currently ARM64 (Apple Silicon) only.
Alternatively, you can build WAVM from source. See Building WAVM from source for instructions.
The wavm executable provides command-line access to WAVM. It has several sub-commands:
-
wavm helpdisplays the available sub-commands, or detailed information about a specific sub-command. -
wavm runloads a WebAssembly file (text or binary) and callsmain(or a specified function). -
wavm assembleloads a WebAssembly text file (WAST/WAT), and saves it as a WebAssembly binary file (WASM). -
wavm disassembleloads a WebAssembly binary file, translates it to the WebAssembly text format, and either prints that text to the console or saves it to a file. -
wavm compileloads a WebAssembly file, and compiles it to one of several formats: unoptimized or optimized LLVM IR, a native object file, or a WebAssembly file with object code embedded in a a custom section (wavm.precompiled_object).
WAVM builds include some simple WebAssembly programs to try. In Windows builds, they will be in
examples. In Linux and macOS builds, they will be in share/wavm/examples. Try running
these example programs:
wavm run examples/helloworld.wast
wavm run examples/zlib.wasm
wavm run examples/trap.wast
wavm run examples/echo.wast "Hello, world!"
wavm run examples/helloworld.wast | wavm run examples/tee.wast
wavm run examples/blake2b.wastwavm disassemble examples/zlib.wasm zlib.wastWAVM supports caching compiled object code for WebAssembly modules. The cache is configured by
setting a WAVM_OBJECT_CACHE_DIR environment variable to point to a directory to store the
cache in.
export WAVM_OBJECT_CACHE_DIR=/path/to/existing/directory
wavm run huge.wasm # Slow
wavm run huge.wasm # FastThe first time wavm loads huge.wasm, it must spend some time to compile it to object code.
The second time wavm loads huge.wasm, it just needs to load its object code from the cache.
For small modules, that may not save much time, but for large WebAssembly modules, that can be
much faster than compiling the module from scratch.