You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit is an initial implementation of resource types for the
component model. The support added in this commit encompasses:
* `wasmparser` - parsing and validation of resource types
* `wasmprinter` - converting binary to text for resource types
* `wast` - parsing the text format for resource types
* `wasm-encoder` - writing the binary format for resource types
Other crates such as `wit-component` and `wasm-compose` saw a few small
changes to continue compiling but do not have support added for resource
types. WIT, for example, continues to not support resource types. That's
planned to be added in a subsequent commit. This support is intended to
be everything necessary for Wasmtime to start working on implementing
resource types, and once that's ready I'll circle back to implement WIT
support with host/guest/etc generators.
This is a substantial commit. The binary format for resources is pretty
minor but the major feature it requires support for is the type-checking
in validation. Resources effectively add an ML-module-style type system
to the component model with abstract types. This required quite a lot of
meticulous and careful plumbing throughout the validator along with a
rewritten form of checking subtypes.
This commit in theory implements what should be all or at least a large
bulk of what's specified for resources at the binary format layer.
Without spec tests for formal spec wording it can't really be said how
close to the current documentation it follows, but the intention was to
follow it closely. Tests have been attempted to be added here in a
number of interesting flavors but this implementation is highly likely
to still have holes and/or bugs that break the guarantees of resources.
Co-authored-by: Trevor Elliott <telliott@fastly.com>
0 commit comments