bytecodealliance/wasmtime

WASI: integrate ABI modules into reserved WASM modules

Closed this issue · 2 comments

https://webassembly.github.io/spec/core/syntax/modules.html

WASM already provides the ability to do modules. WASI should tightly integrate with this rather than putting all the APIs in the default environment module. This would also allow us to version the ABIs.

A WASM application could define that it needs the core1, net2 and filesystem2 modules. The runtime can dynamically adapt to that behavior by loading the correct ABIs according to what the application specified. This allows WASI to make ABI changes. It also allows WASI to be deeply modular. It would be very nice to follow semver here.

WASI Core isn't in the default environment module; it's in the "wasi_unstable" module, which we intend to be temporary. In C header files, this is achieved via the __attribute__((import_module("wasi_unstable"))) mechanism. We can easily change which modules things are imported from once we decide how we want to organize things.

Versioning is an interesting topic that will affect a lot of people in a lot of different ways, so I suggest we defer that discussion until we have a proper forum.

Modularization and versioning are implemented in the WASI repo.