Skip to content

Composable WASI interfaces #262

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

Open
benbrittain opened this issue Apr 23, 2020 · 1 comment
Open

Composable WASI interfaces #262

benbrittain opened this issue Apr 23, 2020 · 1 comment

Comments

@benbrittain
Copy link
Contributor

I'd like WASI function calls to be routed to an instance based on the origin of the handle. This likely requires some dynamic routing capabilities in the wasm runtime.

As things currently work, a module is aware of all it's imports. As we move to a world of "shared-nothing linking", threads, and having the lifetimes of wasm instances decoupled from each other, an interesting problem arises.

Let's imagine two modules both providing the hypothetical standardized wasi file interface. Module A is an in-memory filesystem written in WASM, Module B is the host filesystem. An instance should be able to receive a handle to either module (or even both at the same time!) and call the standardized ready/write/stat/etc.. interfaces on the handle.

Currently, all WASI calls terminate in the engine, nothing else implements these interfaces. If we'd like other modules to be able to mint these capabilities (and other capabilities potentially not defined by WASI), something needs to route the calls.

@sunfishcode
Copy link
Member

This is now partly achieved by having read/write factored out from streamy resources into a dedicated stream type. So instead of having read/write be dynamically routed to files/sockets/bodies, they're now statically routed to the wasi-io stream interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants