wasmi
wasmi copied to clipboard
Implement support for running `wasm32-wasi` compiled Wasm binaries
The WebAssembly System Interface (WASI) is an important part at enabling support for a wide variety of WebAssembly targets.
With wasmi_v1 and its Linker definition it should be very straight forward to implement WASI support for the wasmi interpreter.
Ideally the entire WASI implementation resides in a new sub-crate of the wasmi workspace, called wasi.
This sub-crate implements the WASI interface and provides extension methods for the wasmi_v1::Linker to add WASI support.
As a follow-up feature we could provide an executable for wasmi_v1 that runs input .wasm or .wat files using WASI support out of the box as it is done in Wasmtime.
As an overview of what needs to be implemented you can inspect: https://doc.rust-lang.org/std/os/wasi/index.html The Wasmtime implementation of WASI is also a place to look out for inspiration. Technically we could also use it as a common ground for our WASI support.
Would certainly love to work on this @Robbepop
Would certainly love to work on this @Robbepop
I would certainly appreciate help with this issue! Please feel free to let me know what you need to know and how I can help you with work on this. :)
As a follow-up feature we could provide an executable for wasmi_v1 that runs input .wasm or .wat files using WASI support out of the box as it is done in Wasmtime.
The situation here has significantly improved since creation of the issue since we now have wasmi_cli which is a CLI tool to invoke .wasm and .wat files using wasmi. Therefore as a follow-up we really would love for this CLI tool to have WASI support out of the box.
Link to wasmi_cli: https://github.com/paritytech/wasmi/tree/master/cli
Thanks! I will implement it in drafts. If I need help, I'll let you know.
In case you were not already aware of the Wasmtime wasi-common crate:
https://crates.io/crates/wasi-common/1.0.0
I think it might suite as a good foundation for WASI support in wasmi.
Yes I found it while looking around. I'm making use of it. Thanks!
@OLUWAMUYIWA how is it going with the wasmi WASI implementation so far? Do you need any help or can we somehow support you?
Hi Rob. Apologies. I got stuck at some point. Rather than getting unstuck, I paused and got busier. Still interested. Will pick it up again tomorrow, and ask you some questions. Is there a discord?
Thank you for the response @OLUWAMUYIWA . Looking forward to answer all your questions. :) I was just curious which is why I asked. The folks at CNCF would really love to have WASI support for wasmi though. ^.^
@OLUWAMUYIWA I just sent you an e-Mail with my Discord handle. :) (Did not want to post that publicly here.)