WIT support via wit-bindgen
#703
Replies: 3 comments 3 replies
-
Let me repeat again how cool this is: 🚀🎉 |
Beta Was this translation helpful? Give feedback.
-
Nice work! We're building on substrate, and we're also doing some other Wasm stuff off-chain. So far we've ruled out using wasmi for the offchain part because of no WIT support, but will be reconsidering it if this gets merged, since interpreter is ideal, and could give us the flexability to do WIT on-chain later. Thanks for the efforts here, I'll be keeping eyes on this! :) |
Beta Was this translation helpful? Give feedback.
-
I just pinned this discussion for people to get note of it. See #723 for a usage example with JS types. |
Beta Was this translation helpful? Give feedback.
-
As part of the WebAssembly Component Model proposal, the WIT format is used to describe the interfaces used by components.
There's a cli tool,
wit-bindgen
that can to scaffold the import/export code of a certain component.Currently wit-bindgen can generate export and import code for Wasmtime, but it lacks wasmi support.
In case you're interested, I've created a forked version of wit-bindgen that can generate both import and export code for wasmi.
The code currently lives inside of this repository, under the
wasmi
branch.wit-bindgen is undergoing a lot of changes. I've targeted the
v0.2.0
release, which is the one used by projects like Spin and SpiderLightning.I will not push the code upstream yet, because of all these undergoing changes (see this comment).
I'm opening this issue in case other wasmi users could benefit from using this code.
If you want to see the code in action, you can take a look at this codebase.
Beta Was this translation helpful? Give feedback.
All reactions