Hi,
there is currently no way to handle references in components, right? When returning values from a webassembly guest to a rust host, I always have to copy all values. In the future, one could use resources to do that (https://github.com/bytecodealliance/wasmtime/issues/6583). So right now, if I want to call two separate webassembly functions create_image and process_image from the host, I would have to put the image into a List and basically copy the image from WebAssembly to the host and from the host back to webassembly. With a ressource, I could use a handle to avoid copying the whole image.
Do I understand this correctly?
I believe that's correct, yes. If you're putting an image into a component and eventually getting back out even with resources that'll be two copies. With resources though that could represent the image living in wasm memory for later operations to have to copy in/out the image between the invocations
thank you!
Last updated: Dec 23 2024 at 14:03 UTC