Hello ! I’m learning everything webassembly for 3 days, my head’s gonna explode but I think I’m not that far to succeed! I think so.
When, from a guest, you are generating from a wit. You make your struct, your methods implementing the generated interface… but why are there not self references anymore ? This would be so helpful to create wasm programs which are more than a « call and return »
Well, I struggled to find any documentation, but it seems that what I need is the resource
element. I'm gonna try this out.
Resources are not implemented in the current iteration, they are planned to be added again for the next major version
since each wasm component has entirely separate memory, I would suggest to use global state inside the component if there is data you want to persist between calls of component functions, in Rust that would be something like a OnceCell or lazy_static
Not implemented? How can this issue be resolved then? https://github.com/bytecodealliance/wit-bindgen/issues/178
in the current iteration<
the previous wit files were for wasi commands, which implemented wasi_snapshot_preview1. Right now we are almost at preview2, which is basing everything on the component model, but the component model does not yet have Resources
you can use an old version of wasmtime if you want to play with the deprecated wasi format instead of the component model or you can wait a few more weeks to play witht he new version
Okay I see! Thanks a lot for your answer and time, have a great day :)
bachrc has marked this topic as resolved.
Will the resource be something handled by the component model at some time, or is it again a design?
as far as I'm aware they will absolutely be in the final specification, but I don't know specifics what is blocking what currently
Okay! Thanks a lot :)
Last updated: Dec 23 2024 at 13:07 UTC