Skip to content
/ wvwasi Public

A WebView with WASI may be the best containerized JS/WASM runtime that supports GUI and system APIs. wvwasi is it.

License

Notifications You must be signed in to change notification settings

defims/wvwasi

Repository files navigation

wvwasi

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.

Example Usage

Currently only the Windows platform is implemented, other platforms are on the way.

cargo run --example hello_world --target x86_64-pc-windows-msvc

How does it achieve high performance?

No magic, just IPC and sharedbuffer.

Why not implement WASI using Web APIs?

  1. Webkit oppose File System Access API.
  2. Unable to preopen system folder.
  3. You can not customize your own interface with high-performance communication mechanisms.
  4. You can use native system capabilities, such as sockets at the transport layer, without being limited to websockets at the application layer.

API

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:

System Calls

This section has been adapted from the official WASI API documentation.

About

A WebView with WASI may be the best containerized JS/WASM runtime that supports GUI and system APIs. wvwasi is it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published