vshymanskyy/wasm3 - wapm
Wapm logo
search

The search results will appear here

vshymanskyy/wasm3WASI

0.4.2 Public • Published 14 days ago41.01 KB

Wasm3 is a high performance WebAssembly interpreter written in C. You can finally run WebAssembly on WebAssembly 😆

Copy and paste to install this package
wapm install vshymanskyy/wasm3

homeHomepage

launchGithub (grade - call_split - error_outline - open issues/PRs)

Wasm3

Wasm3 is a high performance WebAssembly interpreter written in C.
It's packaged into a WebAssembly package, so you can finally run WebAssembly on WebAssembly 😆

When running natively, wasm3 is:

∼ 15.8x faster than other wasm interpreters (wac, life, wasm-micro-runtime)
∼ 4..5x slower than state of the art wasm JIT engines (liftoff, cranelift)
∼ 11.5x slower than native execution

Based on CoreMark 1.0 benchmark. Your mileage may vary.

Running on WebAssembly.sh

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 interactive mode:

$ wasm3 --repl /fib32.wasm
wasm3> fib 20
Result: 6765
wasm3> fib 30
Result: 832040
wasm3> ^C
$

Or run a specific function directly:

$ wasm3 --func fib /fib32.wasm 30
Result: 832040

wasm3 also supports WASI, so you can run:

$ curl https://raw.githubusercontent.com/wasm3/wasm3/master/test/wasi/test.wasm -o /wasi-test.wasm
$ wasm3 /wasi-test.wasm

or even... bash wasm3 /tmp/wasm3.wasm /wasi-test.wasm