From 80f1f55047f6fde8f01a9c0a3c71d27f3a3d8967 Mon Sep 17 00:00:00 2001 From: kajacx Date: Wed, 24 Apr 2024 11:02:49 +0200 Subject: [PATCH] Added alternatives section --- README.md | 12 ++++++++++++ tests/wasi_components/io_redirect/host.rs | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 26ed9a2..a3bbff7 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,24 @@ Alternatively, refer to this handy table: | `wasm-bridge` | `wasmtime` | `wit-bindgen` | `cargo-component` | | --- | --- | --- | --- | +| `0.5.x` | `20.0` | `0.24.0` | `0.11.0` | | `0.4.x` | `19.0` | `0.24.0` | `0.10.1` | | `0.3.x` | `15.0` | `0.15.0` | `0.5.0` | | `0.2.x` | `11.0` | `0.8.0` | - | | `0.1.x` | `10.0` | - | - | +## Alternatives + +There are other options for loading and executing WASM modules on the desktop and on the web in RUST: `wasmer` can run on the web with the `js` feature flag, `wasmi` is an interpreter so it has no problem running on the web, and `wasm_component_layer` provides a unified API that can be "backed" by a number of "backends". + +| Crate | Short description | Component model | Wasi support | +| --- | --- | --- | --- | +| `wasm-bridge` | Re-exports `wasmtime` on sys, `js-sys` impl on web. | Yes, but no resources. | Partially yes. | +| [`wasmer`](https://github.com/wasmerio/wasmer) | Native impl in sys, `js-sys` impl on web. | They have [`wai` bindgen](https://github.com/wasmerio/wai). | [Yes](https://crates.io/crates/wasmer-wasi). | +| [`wasmi`](https://github.com/wasmi-labs/wasmi) | Lightweight WASM interpreter, run anywhere. | [Planned](https://github.com/wasmi-labs/wasmi/issues/897). | Experimental [`wasmi_wasi`](https://github.com/wasmi-labs/wasmi/tree/master/crates/wasi) crate. | +| [`wasm_runtime_layer`](https://github.com/DouglasDwyer/wasm_runtime_layer) | Thin wrapper around `wasmtime` or `wasmi`, `js-sys` impl on web. | [`wasm_component_layer`](https://github.com/DouglasDwyer/wasm_component_layer), but no bindgen. | Not to my knowledge. | + ## License The source code of `wasm-bride` is licensed under MIT, but there are portions that are copied from other projects, diff --git a/tests/wasi_components/io_redirect/host.rs b/tests/wasi_components/io_redirect/host.rs index 79d4747..4955567 100644 --- a/tests/wasi_components/io_redirect/host.rs +++ b/tests/wasi_components/io_redirect/host.rs @@ -155,7 +155,6 @@ impl Subscribe for OutStream { async fn ready(&mut self) {} } - impl HostOutputStream for OutStream { fn write(&mut self, buf: Bytes) -> StreamResult<()> { assert!(buf.len() <= self.max, "We specified to write at most {} bytes at a time.", self.max);