-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add a component-model
feature to wasmparser
#1845
Add a component-model
feature to wasmparser
#1845
Conversation
Note that this is built on #1844 for now and is separated out into a few refactoring commits as well (after that PR) |
This commit splits the `types.rs` in `wasmparser` into a `types.rs` and `component_types.rs`. The goal here is to split all component-related logic to a separate file instead of having everything bundled together. This will make it easier to conditionally include component-related bits in the future and additionally make each module more understandable by focusing only on one piece of functionality.
Don't `pub use` all the types from that module into the preexisting `types` module. This helps reduce the cognitive load when looking at the `types` module by keeping all the component bits in one place.
This commit gates the implementation of the component-model proposal in `wasmparser` behind a Cargo feature named `component-model`. This is intended to lower the binary size and compile time of this crate in situations where components are not needed. Additionally this helps factor logic cleanly between core module and component layers both at the API and internal levels.
d495f3e
to
5a3dc81
Compare
I just updated this Wasmi PR to use the new v0.218.0:
v0.219.0:
I looked at @alexcrichton What do you think about a small re-design with which it is possible to also put those dependencies (and associated code in
These 2 new crate features are additive. 4 cases:
Thus btree-based collections always exist while hash-based collections are optional. This is natural for To keep semantics the same as before by default only the This covers all use-cases while also allowing to get rid of the hash-based collections altogether, also from dependency graph. What do you think about this? Is there an even simpler design alternative? What I like in particular about this design is that crate feature names no longer contain a negation. Negations keep twisting my brain. |
That seems like a promising idea yeah! I'm not sure I 100% follow in some points though because there are public types in the Regardless though I'd be happy to see changes in this regard (I agree on preferring "positive" features) so I'm also happy to review PRs along these lines. |
Okay good to know. I will hopefully have more time starting next week to dig into this and come up with PRs. |
This commit gates the implementation of the component-model proposal in
wasmparser
behind a Cargo feature namedcomponent-model
. This isintended to lower the binary size and compile time of this crate in
situations where components are not needed. Additionally this helps
factor logic cleanly between core module and component layers both at
the API and internal levels.