-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASI support for custom targets #10075
Comments
The documentation here more-or-less outlines why the Unfortunately though there's not necessarily a super-small C API we can offer and say "implement this and you get all of WASI". What I might recommend instead is to avoid using the I'll note that this is also not the greatest state of things as reimplementing the If it works for your use case I might recommend providing only a few WASI interfaces and grow that set over time. For example you probably want Finally I'll also note that @pchickey is doing work to get |
Agree with Alex - its very hard to come up with a pluggable implementation of WASI that meets the needs of different platforms while still having enough in common across platforms to be worthwhile. The wasmtime-wasi-io crate, which just landed in main, is a no_std implementation of the WASI poll function, and a set of traits for input-stream, output-stream, and pollable. Its just barely enough common ground for implementations to be worth having at all. Once you have that, you still have to build up a lot of other functionality to be able to embed apps that use stdin/out, sockets, etc, and how you do so is heavily dependent on your underlying platform. My suggestion is to invoke At some point in the future I will add an example app that uses wasmtime-wasi-io to make a sample embedding, but right now I'm burning down other things on my critical path so that remains tech debt for today. |
From the docs
This is basically what I need, so I'd like to know(and possibly contribute) what would it take to add WASI support to the no_std version of Wasmtime.
I'm creating a simple "virtual OS" for embedded risc-v and a custom risc-v based VM and would like to run WASI programs on it, the fact that programs need to be pre-compiled ahead of time is actually a plus as it allows distributing the binaries in the VM's format instead of WASM.
An initial MVP would be running a simple WASI component with
wstd
that reads form stdin and write to stdout and another one that creates a service listening on a socket. The OS abstracts the concept of the filesystem or networking.The text was updated successfully, but these errors were encountered: