Stream: general

Topic: WASI + WebGL/WebGPU in the browser?


view this post on Zulip Bogdan Arabadzhi (Apr 10 2025 at 17:00):

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?

view this post on Zulip Ralph (Apr 10 2025 at 17:03):

@Sean Isom or @Mendy Berger might have comments

view this post on Zulip Sean Isom (Apr 10 2025 at 18:19):

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.

view this post on Zulip Sean Isom (Apr 10 2025 at 18:21):

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.

view this post on Zulip Sean Isom (Apr 10 2025 at 18:21):

Happy to talk through it sometime if you want to join one of the wasi-gfx weekly calls

view this post on Zulip Mendy Berger (Apr 10 2025 at 18:35):

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.

Contribute to MendyBerger/browser.wit development by creating an account on GitHub.

Last updated: Dec 06 2025 at 05:03 UTC