-
Notifications
You must be signed in to change notification settings - Fork 77
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
Importing a runtime's WASI implementation #122
Comments
Such a mechanism should be something that can easily be layered on top of this API. I see no particular reason why it would require special engine support. (In fact, something would arguably be wrong with WASI if it did.) |
I think the C API will often be used alongside WASI. Indeed I'm been thinking about writing a small wasi implementation that then uses the C API to load and then modules. But I think the C API and WASI are complementary and orthogonal. |
My concern of not having a way to do this via the C API means that it reduces the portability of swapping out one WASI-implementing engine for another from the point of view of the embedder. We can of course add extra API to do this in Wasmtime, but I feel it's aligned with the intention of the C API to have a standard way of interacting with Wasm engines. It wouldn't mean that engines have to provide a WASI implementation (the embedder is still free to do so), just that if one is available it could be used. |
My understanding is that the C API, if correctly used within wasmtime, would allow wasmtime's WASI implementation to be engine-agnostic (e.g. you could swap out cranelift for v8 and everything would just work with wasmtime's WASI impl and frontend driver). I don't see why one would want to consider WASI (or any other APIs) part of the engine. In the same way that JS engines (in general) don't implement web APIs. |
Maybe a higher level API might make sense? wasi-c-api? |
What @sbc100 said. WASI and a Wasm engine are quite separate concepts, and avoiding monolithic structure is a win. Moreover, not all clients of a Wasm engine will have a use for the WASI infrastructure. |
Now that I said it maybe |
I think having a I think we can move the discussion there, so I'll open a new issue. |
Have we given any thought to an API for instantiating a module with imports from a runtime's WASI implementation, if one is available?
As an example, Wasmtime has a WASI implementation and also implements the C API. For embedders of Wasmtime using the C API, it would be nice to tell the runtime to automatically import WASI when instantiating a module.
This would preclude the need for an embedder to roll their own WASI implementation when the runtime might already implement one.
The text was updated successfully, but these errors were encountered: