Open2

wasm の実行環境についてメモ

kokorokokoro

まずはざっと列挙

https://github.com/bytecodealliance/wasmtime
https://github.com/bytecodealliance/wasm-micro-runtime
https://github.com/wasm3/wasm3
https://github.com/emscripten-core/emscripten

wasmtime: WebAssembry のランタイム。AOT もある。WASI 対応。
wasm-micro-runtime(WAMR): WebAssembry の軽量なランタイム

bytecodealliance 謹製の両者の差別化ポイントは気になるので調査する。

wasm3: WebAssembry のインタプリタ。最速をうたっている。

wasm3 は素直な実装で大半の環境でほとんど手を加えずビルドが通せそう。

kokorokokoro

wasmtimeをビルドする。前提として rust の開発環境が必要になる。

https://docs.wasmtime.dev/contributing-building.html

git submodule update --init

Wastime CLI のビルド(target/release/wasmtime.exe)

cargo build --release

Wasmtime C API のビルド(target/release/wasmtime.{lib,dll,dll.lib})

cargo build --release --manifest-path crates/c-api/Cargo.toml

以下がビルドされる。

target/release/wasmtime.dll
target/release/wasmtime.dll.lib
target/release/wasmtime.exe
target/release/wasmtime.lib