#i64 #i32 #mod #call #wasi-binio-host #wasi-binio-wasm #wasi-binio-shared

wasi_binio_shared_mods

wasi_binio_shared mods for wasi_binio_host and wasi_binio_wasm

1 unstable release

0.1.0 Apr 2, 2020

#869 in WebAssembly


Used in 2 crates

MIT license

3KB

wasi_binio_shared for wasi_binio_host and wasi_binio_wasm

wasi_binio_wasm is the host crate of wasm_binio. Another crate is wasi_binio_host which used in host. wasi_binio_host creates a call_stub so that host can call a webassembly function with complex data structure arguments and results. wasi_binio_wasm prepare the linear memory buffer and exports required wasm function so that the host can call.

As of today, wasm function can only take i32 i64 f32 f64 types. If you have a function in wasm like this In wasm: do_compute(point1: &Point, point2: &Point)->Rect {...} there is no way to call it directly from host. With the help from wasm_binio, we can instead call the call_stub function and send arguments and results like this

No runtime deps