Hi there, we're considering depending on wit-bindgen at my project, and https://github.com/bytecodealliance/wit-bindgen suggested we reach out here first.
We have what looks to be a very well known problem: I'd like to build a wasm binary from rust code, but it contains C++ dependencies (built with the wasi-sdk clang toolchain). wasm-bindgen is effectively not an option in this case (right?), so wit-bindgen appears to be the main alternative.
And I love what I see with wit-bindgen, in fact I'd prefer its over wasm-bindgen, but it feels like it's in rapid development mode now and fairly
unstable (last release was v0.2.0 from August 2022).
So I had a couple questions,
1. v0.2.0 seems like it's not emitting any bindings for resource
methods, is that feature known to be missing in v0.2.0?
2. Having support for callbacks in the interface is important for us, but I don't see that mentioned in the spec, am I missing something or is it just not spec'd yet?
3. Are there any known stable commits more recent than v0.2.0 I could use?
4. If wit-bindgen doesn't make sense for me, does anyone have any suggestions for building rust+c wasm packages?
Thanks!
The tests are failing while running cargo test --workspace (commit https://github.com/bytecodealliance/wit-bindgen/tree/98c2b1e4cb10d3757114b7524d112511a4c7459e) in the devcontainer. Any idea?
resource
back to wit. Thanks!
It sounds like it's going to be a bit of a rollercoaster ride while the wasm component model changes are happening, so I'll leave trunk alone.
Maybe I can make v0.2 work for me. Feels like this is almost the only option for creating wasm bindings for Rust when it's compiled under wasm32-wasi
.
You can take a look at https://github.com/fermyon/wit-bindgen-backport as an example of backporting dependency updates to v0.2. That repo in particular has no stability guarantees though so you may want to fork it if its useful to you.
Ahh, thanks, good to know.
Is there a list of projects that are depending on wit-bindgen (either v0.2 or otherwise) that I might use as reference?
Not that I'm aware of. Sourcegraph or github search are probably your best bet for that.
Last updated: Dec 23 2024 at 12:05 UTC