A WebView with WebAssembly System Interface (WASI) may be the best Javascript/WebAssembly runtime, and wvwasi
is it.
|
Javascript/WebAssembly code | Javascript/WebAssembly application code
| |
| v
| WASI syscalls (inserted by compiler toolchain)
| |
------------------------------+ |
| v
Javascript/WebAssembly runtime| wvwasi (implementation WASI in webview)
(WebView) | |
| v
| platform-specific calls
|
(Hence wvwasi isn't for making programs execute on WASI runtimes. That would either be a wasm32-wasi target complied by rust, or done through POSIX emulation by the Emscripten or wasi-sdk toolchains.)
WARNING: This is a alpha. Work in progress.
Currently only the Windows platform is implemented, other platforms are on the way.
bash
cargo run --example hello_world --target x86_64-pc-windows-msvc
The WASI API is versioned. This documentation is based on the WASI preview 1
snapshot. wvwasi
implements the WASI system call API with the following
additions/modifications:
This section has been adapted from the official WASI API documentation.