Wasm3 is a high performance WebAssembly interpreter written in C. So you can finally run WebAssembly on WebAssembly 😆
When running natively, wasm3 is:
∼ 13.5x faster than other wasm interpreters (wac
, life
, wasm-micro-runtime
)
∼ 5..6x slower than state of the art wasm JIT
engines (liftoff
, cranelift
)
∼ 12.5x slower than native execution
Based on CoreMark 1.0 benchmark. Your mileage may vary.
First you need to make a wasm file you want to run available in the filesystem.
One way to do this is to get it from a server using curl
command:
$ curl https://raw.githubusercontent.com/wasm3/wasm3/master/test/lang/fib32.wasm -o /fib32.wasm
$ ls -l /fib32.wasm
---------- 1 somebody somegroup 62 1970-01-19 05:45 /fib32.wasm
Now we can run wasm3
in repl mode:
$ wasm3 --repl /fib32.wasm
wasm3> fib 20
Result: 6765
wasm3> fib 30
Result: 832040
wasm3> ^C
$