| Crates.io | wvwasi |
| lib.rs | wvwasi |
| version | 0.2.0 |
| created_at | 2023-07-04 04:19:49.42732+00 |
| updated_at | 2024-03-17 13:23:04.512965+00 |
| description | A WebView with WASI may be the best JS/WASM runtime, and wvwasi is it. |
| homepage | https://wvwasi.com |
| repository | https://github.com/defims/wvwasi |
| max_upload_size | |
| id | 907633 |
| size | 283,497 |
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.
cargo run --example hello_world --target x86_64-pc-windows-msvc
No magic, just IPC and sharedbuffer.
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.
wvwasi.wasiSnapshotPreview1.fd_advise()wvwasi.wasiSnapshotPreview1.fd_allocate()wvwasi.wasiSnapshotPreview1.fd_close()wvwasi.wasiSnapshotPreview1.fd_datasync()wvwasi.wasiSnapshotPreview1.fd_fdstat_get()wvwasi.wasiSnapshotPreview1.fd_fdstat_set_flags()wvwasi.wasiSnapshotPreview1.fd_fdstat_set_rights()wvwasi.wasiSnapshotPreview1.fd_filestat_get()wvwasi.wasiSnapshotPreview1.fd_filestat_set_size()wvwasi.wasiSnapshotPreview1.fd_filestat_set_times()wvwasi.wasiSnapshotPreview1.fd_pread()wvwasi.wasiSnapshotPreview1.fd_prestat_get()wvwasi.wasiSnapshotPreview1.fd_prestat_dir_name()wvwasi.wasiSnapshotPreview1.fd_pwrite()wvwasi.wasiSnapshotPreview1.fd_read()wvwasi.wasiSnapshotPreview1.fd_readdir()wvwasi.wasiSnapshotPreview1.fd_renumber()wvwasi.wasiSnapshotPreview1.fd_seek()wvwasi.wasiSnapshotPreview1.fd_sync()wvwasi.wasiSnapshotPreview1.fd_tell()wvwasi.wasiSnapshotPreview1.fd_write()wvwasi.wasiSnapshotPreview1.path_create_directory()wvwasi.wasiSnapshotPreview1.path_filestat_get()wvwasi.wasiSnapshotPreview1.path_filestat_set_times()wvwasi.wasiSnapshotPreview1.path_link()wvwasi.wasiSnapshotPreview1.path_open()wvwasi.wasiSnapshotPreview1.path_readlink()wvwasi.wasiSnapshotPreview1.path_remove_directory()wvwasi.wasiSnapshotPreview1.path_rename()wvwasi.wasiSnapshotPreview1.path_symlink()wvwasi.wasiSnapshotPreview1.path_unlink_file()wvwasi.wasiSnapshotPreview1.poll_oneoff()wvwasi.wasiSnapshotPreview1.proc_exit()wvwasi.wasiSnapshotPreview1.proc_raise()wvwasi.wasiSnapshotPreview1.sched_yield()wvwasi.wasiSnapshotPreview1.random_get()wvwasi.wasiSnapshotPreview1.sock_accept()wvwasi.wasiSnapshotPreview1.sock_recv()wvwasi.wasiSnapshotPreview1.sock_send()wvwasi.wasiSnapshotPreview1.sock_shutdown()