pchickey opened Issue #2001:
This is a good beginner issue that is scoped to the wasmtime-wiggle crate, at crates/wiggle/wasmtime.
See also #2000, cc @jedisct1
I propose that
wasmtime_wiggle::wasmtime_integration!
generate an additional functionlink_all(&ctx, &Store, &mut Linker) -> Result<(), _>
that constructs and links each module struct generated by the macro. This will make it hard to accidentally forget to instantiate and link in a module when maintaining an integration of several witx modules.<!-- Please try to describe precisely what you would like to do in
Cranelift/Wasmtime and/or expect from it. You can answer the questions below if
they're relevant and delete this text before submitting. Thanks for opening an
issue! -->Feature
<!-- What is the feature or code improvement you would like to do in
Cranelift/Wasmtime? -->Benefit
<!-- What is the value of adding this in Cranelift/Wasmtime? -->
Implementation
<!-- Do you have an implementation plan, and/or ideas for data structures or
algorithms to use? -->Alternatives
<!-- Have you considered alternative implementations? If so, how are they
better or worse than your proposal? -->
pchickey edited Issue #2001:
This is a good beginner issue that is scoped to the wasmtime-wiggle crate, at crates/wiggle/wasmtime.
See also #2000, cc @jedisct1
I propose that
wasmtime_wiggle::wasmtime_integration!
generate an additional functionlink_all(ctx, &Store, &mut Linker) -> Result<(), _>
that constructs and links each module struct generated by the macro. This will make it hard to accidentally forget to instantiate and link in a module when maintaining an integration of several witx modules.Frank has pointed out that this is impossible since each module presently requires an owned
ctx
value, maybe using Rc<> in the ctx type will help here? This could have inadvertently revealed more problems that we hadn't thought of yet.<!-- Please try to describe precisely what you would like to do in
Cranelift/Wasmtime and/or expect from it. You can answer the questions below if
they're relevant and delete this text before submitting. Thanks for opening an
issue! -->Feature
<!-- What is the feature or code improvement you would like to do in
Cranelift/Wasmtime? -->Benefit
<!-- What is the value of adding this in Cranelift/Wasmtime? -->
Implementation
<!-- Do you have an implementation plan, and/or ideas for data structures or
algorithms to use? -->Alternatives
<!-- Have you considered alternative implementations? If so, how are they
better or worse than your proposal? -->
pchickey edited Issue #2001:
This is a good beginner issue that is scoped to the wasmtime-wiggle crate, at crates/wiggle/wasmtime.
See also #2000, cc @jedisct1
I propose that
wasmtime_wiggle::wasmtime_integration!
generate an additional functionlink_all(ctx, &Store, &mut Linker) -> Result<(), _>
that constructs and links each module struct generated by the macro. This will make it hard to accidentally forget to instantiate and link in a module when maintaining an integration of several witx modules.Frank has pointed out that this is impossible since each module presently requires an owned
ctx
value, maybe using Rc<> in the ctx type will help here? This could have inadvertently revealed more problems that we hadn't thought of yet.
Last updated: Nov 22 2024 at 17:03 UTC