bytecodealliance / wasm-tools

CLI and Rust libraries for low-level manipulation of WebAssembly modules
Apache License 2.0
1.3k stars 235 forks source link

Compose direct cyclic component dependencies #1165

Closed juntyr closed 1 year ago

juntyr commented 1 year ago

At the moment, component dependencies must be entirely acyclic. However, additional functionality could be enabled by allowing wasm-compose to resolve a direct cyclic dependency pair such as B <-> C:

to transform it into:

Would something like this ever be possible or is it entirely incompatible with the component model?

alexcrichton commented 1 year ago

I think that the way this would look is that the "BC" in your above example would be a single component that itself perhaps shares memory with core wasm modules (or not, either way). I'm not aware of any means myself to go from a component B and a compnent C that cyclicly depend on each other to a "BC" which works.

juntyr commented 1 year ago

Ok, thanks for your insight!