wasm_run 0.1.0+1 copy "wasm_run: ^0.1.0+1" to clipboard
wasm_run: ^0.1.0+1 copied to clipboard

Web Assembly executor. Uses Rust's wasmtime optimizing runtime or wasmi interpreter.

wasm_run #

A Web Assembly executor for the Dart programming language.

Currently it uses the wasmtime 14.0 or wasmi 0.31 Rust crates for parsing and executing WASM modules. Bindings are created using package:flutter_rust_bridge.

For more information on usage and documentation, please visit the main repository: https://github.com/juancastillo0/wasm_run.

Pure Dart (Native) #

For pure Dart application (backend or cli, for example), you may download the compiled dynamic libraries for each platform and specify the ffi.DynamicLibrary in the WasmRunLibrary.set function or execute the script dart run wasm_run:setup (or the function WasmRunLibrary.setUp) to download the right library for your current platform and configure it so that you don't need to call WasmRunLibrary.set manually. The compiled libraries can be found in the releases assets of this repository.

Flutter #

When using it in a Flutter project you should use package:wasm_run_flutter instead, since it will provide the right binaries for your platform.

Dart Web (Not Flutter Web) #

We use the wasm-feature-detect JavaScript library for feature detection in the browser. To use this functionality in Dart web applications you will need to add the following script to your html (not necessary for Flutter):

<script src="./packages/wasm_run/assets/wasm-feature-detect.js"></script>
<script type="module" src="./packages/wasm_run/assets/browser_wasi_shim.js"></script>
6
likes
120
pub points
51%
popularity

Publisher

unverified uploader

Web Assembly executor. Uses Rust's wasmtime optimizing runtime or wasmi interpreter.

Repository (GitHub)
View/report issues

Topics

#wasm #interop #runtime #interpreter #ffi

Documentation

API reference

License

MIT (LICENSE)

Dependencies

collection, ffi, flutter_rust_bridge, freezed_annotation, logging, meta, wasm_interop

More

Packages that depend on wasm_run