A small standalone WebAssembly interpreter in Rust. Currently not really usable, yet.
This is a hobby project, not intended to be a professional-grade tool. But if it gets to that point, great! I think a small, lightweight interpreter would be really useful for things like embedding, running unit tests on generated wasm code, as an extension system, etc.
The road map is, more or less in order:
no_std
for the wasm32-unknown-unknown target, and provide a basic console APIunsafe
; if we can make a significant performance win with unsafe code, we should. Properly-validated WebAssembly code should be safe itself. Naturally, not using unsafe would be best.Fetch and build wabt, which contains useful low-level tools like assemblers.
sudo apt install clang cmake
git clone --recursive https://github.com/WebAssembly/wabt.git
cd wabt
make -j$(nproc)
The assembler is wat2wasm
, so use that.
cd test_programs
wat2wasm inc.wast
This should create a inc.wasm
program which is what you can actually load and run:
cargo run -- test_programs/inc.wasm
...except the bin target doesn't actually use the interpreter yet XD
Apache/MIT