Implement a composition graph library.#63
Merged
peterhuene merged 12 commits intomainfrom Apr 5, 2024
Merged
Conversation
Member
Author
|
Note that the new Once this merges, I plan on updating I'll be pushing up more test cases shortly. |
This commit implements a composition graph library that will serve as the basis for how WAC does AST resolution in the near future. The inspiration comes from the existing `CompositionGraph` API in `wasm-compose`, except this API is more flexible, allowing a composition graph to define its own types, have explicit exports, and export any node in the graph. The type representation present in `wac-parser` has been extracted to its own crate, `wac-types`. It will be shared in the future between the parser and the graph library. As a result, a chunk of this new code is just copied out of `wac-parser`. Once the graph library is merged, a follow-up commit will eliminate the duplicated code and change `wac-parser` to resolve ASTs to a `CompositionGraph`.
This includes a rename of `float32` to `f32` and `float64` to `f64`.
The parser should depend on the graph, not the resolver crate.
rylev
approved these changes
Apr 3, 2024
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Find defined type id used in remapping in `ItemKind::Type`
fibonacci1729
approved these changes
Apr 4, 2024
rylev
approved these changes
Apr 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a composition graph library that will serve as the basis for how WAC does AST resolution in the near future.
The inspiration comes from the existing
CompositionGraphAPI inwasm-compose, except this API is more flexible, allowing a composition graph to define its own types, have explicit imports and aliases, and export any node in the graph.The type representation present in
wac-parserhas been extracted to its own crate,wac-types. It will be shared in the future between the parser and the graph library.As a result, a chunk of this new code is just copied out of
wac-parser. Once the graph library is merged, a follow-up commit will eliminate the duplicated code and changewac-parserto resolve ASTs to aCompositionGraph.