Hi, I'm evaluating the use of Rust/WASM to port the core 3D of our application.
Nothing against WASM, but I much prefer to use WIT as a single source of truth for the interface.
wasi-gfx looks promising, but it is kinda early? Any advice on how to proceed? Can I combine WIT + WASM (Rust) + WebGL (via externref) or something similar, maybe?
@Sean Isom or @Mendy Berger might have comments
Hi! The webgpu portion of wasi-gfx is relatively stable, I wouldn't hesitate to use it. Wasi-surface is still evolving. There is no implementation of WebGL yet. The interface is flexible enough that it could easily be added. The WIT for WebGPU is (mostly) mechanically translated from the WebIDL using @Mendy Berger 's open source tools so you could take a similar approach.
The hardest part is going to be hooking up a backing implementation on the host side of the WIT. For wasi-gfx-runtime this is done via wgpu-core, with a lot of handwritten wrapper code to interface with the rust that is generated from the WIT host bindings. You'd need to do the same, probably to opengl es apis directly.
Happy to talk through it sometime if you want to join one of the wasi-gfx weekly calls
Happy to talk through it on the wasi-gfx calls as well, though I won't be there for the next one.
If you're targeting webgl in the browser specifically, browser.wit might be a better fit, as wasi-gfx doesn't have OpenGL support (yet?). It's not as stable yet, but we're working hard on stabilizing it.
Last updated: Dec 06 2025 at 05:03 UTC