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
Is there anyone already working on a draft for adding runtime instantiation to the component model?
Runtime instantiation means that a component can dynamically instantiate another component given its binary representation, and then invoke them. This is needed to have something similar to exec, where the number of imported instances and even the module code itself is not statically predefined but evolves programmatically. Currently one could define a custom protocol between the runtime and a component to have a similar effect. Use cases are flexible reusing of modules, runtime generation or fetching of modules (network or from disk), and a small demo program you could think of is a wasm component shell or wac REPL that itself runs as wasm component.
(Oh haha, I was confused by my above comment before seeing that Dan transferred it :P)
I'm not working on a draft yet, but once 0.3-async is closed out, this is one of the last significant feature I am quite keen to add to the CM for a 1.0 MVP, because I totally agree with those use cases you mention being important.
The rough shape of the feature here is a new canon built-in that allows "resourceifying" any component (nested or imported) to produce:
a new resource type representing instances of that component
a new function that runtime-instantiates that component, returning an owned handle of type (1)
for each export of that component, a function that prepends to the original parameters a borrowed handle of type (1)
But lots more work to turn this idea into a real draft proposal; I'm sorry there's not more worked out yet.
Is there anyone already working on a draft for adding runtime instantiation to the component model?
Runtime instantiation means that a component can dynamically instantiate another component given its binary representation, and then invoke them. This is needed to have something similar to
exec
, where the number of imported instances and even the module code itself is not statically predefined but evolves programmatically. Currently one could define a custom protocol between the runtime and a component to have a similar effect. Use cases are flexible reusing of modules, runtime generation or fetching of modules (network or from disk), and a small demo program you could think of is a wasm component shell or wac REPL that itself runs as wasm component.A few links in Luke's answer here: WebAssembly/wasi-cli#25
The text was updated successfully, but these errors were encountered: