-
Notifications
You must be signed in to change notification settings - Fork 89
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
Proposal: Component Model v0 #479
Comments
That's a fair question and there are couple of options already in progress:
The former is valuable to simplify the lives of producer toolchains: they can just target the core ABI and then anyone downstream can use a tool like The latter approach is valuable to simplify the lives of runtimes and I think could be generalized to apply to more core runtimes. E.g., I could imagine a standalone project for a "component precompiler" tool that factored as much as it could out of jco, gravity and wasmtime. I think mainly what we'd need here is folks who use or build these core runtimes to help scope out and work on this tool. I think these two approaches would go much farther in allowing incremental adoption of the Component Model than trying to scope down the Component Model (e.g., trimming out async), although if there was a concrete use case where someone thought this would help, I'd be happy to discuss the options here. Hope that helps, happy to discuss more. |
I can agree with this option as a method to produce core wasm, intermediate representations, and components from a single source core wasm module. Implementation of this on the consumer side, however, would require either using a single module exclusively or reinventing the linking part of the component model, neither of which would scale as a standard (but again, WASI 0.1 is still being used due to this implementation issue for the Component Model).
While these specialized tools can be generalized, most of their effort is concentrated around Maybe there's another way to kick off implementation (not just adoption) of the component model that I haven't seen though. Thoughts?
Existing tools are very close to this minimal subset; Binaryen, for instance, can easily implement it, given its built-in support for module merging. I would also see the subset as a stepping stone to full Component Model implementation in other tools--a consumer-side version of wasit2.
|
IIUC, vscode made their own implementation of the component model that does not rely on |
Looking at it, it seems to only implement the Canonical ABI for a single module, and cannot parse components at all. It still works better than the current status-quo, where everyone forks WASI 0.1 with ad-hoc interfaces, though. const module = await WebAssembly.compile(bits); |
WasmEdge also has an independent component-model implementation in progress which is working well enough to support wasi-http. |
Currently, the component model is very complicated and difficult to understand and to implement. In particular,
wasmtime
has the only working implementation of the component nodel:wasmtime-environ
, which is used by Rust dependents to lower the component model into a representation they can handle, which still has many layers of confusing abstraction.I propose we create a minimal subset of the component model which can be implemented by other, external, runtimes and compilers, including:
externref
s are disallowed as handle typesThis subset, which I propose to call Component Model v0, should include most single-module components, allowing external tools to parse this simplified representation and thus implement WASI 0.2 for it. At a later point, when the external tool is fully developed, the full component model might be implemented within that tool.
First mention of this complexity
TODO: compare with wasit2
TODO: finalize restrictions
The text was updated successfully, but these errors were encountered: