A small, embeddable WebAssembly runtime for memory-constrained environments.
wasmu is primarily designed as a runtime for WebAssembly apps on the DigiCron retro smartwatch. wasmu focuses more on memory usage over performance, making it suitable for any environment where memory usage is a concern.
The name wasmu is a play on words — wasm is an initialism for WebAssembly, and mu — or µ — is the SI unit prefix for micro.
- In-place interpretation, meaning that wasmu doesn't try to recompile the WebAssembly code into native machine code or another intermediate representation
- Low memory footprint — wasmu only needs to allocate a few tables and stacks alongside your WebAsesmbly code buffer
- Architecture-independent — works on a wide range of CPU architectures
- Embeddable — single-header file that doesn't need
stdio
orstdlib
to get working- Written in C, can also be embedded in C++ projects
- Steppable interpreter, preventing infinite loops in WebAssembly from blocking the main thread
- Customisable to fit your specific needs
- Define native modules that can be called from WebAssembly code
- Designed for microcontrollers, but works on conventional computers and other platforms
Before building wasmu, you will need to install some dependencies:
sudo apt install gcc wabt
To build the library, run:
./build.sh
The built library will then be available at dist/wasmu.h
, with the configuration header file at dist/wasmu-config.h
.
To run the unit tests, run:
./build.sh --test
Logs for each test are available at test/$TEST/build/test.log
, where $TEST
is the name of a test.