Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's really interesting how the natural ecosystem for wgpu and wasm seems to be Rust, when C++ is also a prime candidate. Could this be the recency bias associated with Rust being the new kid in the block?


Zig fits pretty naturally here too. We've got ~19 WebGPU examples[1] which use Dawn natively (no browser support yet), and we build it using Zig's build system so it 'just works' out of the box with zero fuss as long as you grab a recent Zig version[2]. No messing with cmake/ninja/depot_tools/etc.

WASM support in Zig, Rust, and C++ is also not equal. C++ prefers Emscripten which reimplements parts of popular libraries like SDL, for me personally that feels a bit weird as I don't want my compiler implementing my libraries / changing how they behave. Rust I believe generally avoids emscripten(?), but Zig for sure lets me target WASM natively and compile C/C++ code to it using the LLVM backend and soon the custom Zig compiler backend.

[1] https://github.com/hexops/mach-examples

[2] https://github.com/hexops/mach#supported-zig-version


> ...Emscripten which reimplements parts of popular libraries like SDL

AFAIK those library headers are just historical artifacts from a time when those library didn't have official Emscripten ports, and which today are only reluctantly maintained if at all.

Emscripten's web API wrappers make a lot of sense though, and the other unique feature is the 'inline Javascript' support (so you don't need to maintain the Javascript glue code in separate .js source files).


interesting; I didn't realize libraries were adding official emscripten ports using the emscripten APIs. That's definitely a level up in my eyes, then.


At least SDL2 has 'proper' Emscripten support:

https://wiki.libsdl.org/SDL2/README/emscripten

My own cross-platform headers too:

https://github.com/floooh/sokol

...there are also auto-generated Zig bindings btw ;)

https://github.com/floooh/sokol-zig


It's probably as simple as 'cargo vs cmake'. wgpu-native is a regular cargo package which is straightforward to integrate and build. Google's libdawn is a mix of cmake and Google depot tools, which makes the same process anything but trivial.

I don't agree with your take on WASM though. Emscripten does a pretty good job of making developer's life easier.

(there's also a real need for a medium-level cross-platform GPU API which abstracts over D3D12, Vulkan and Metal, and WebGPU seems to be the most robust option for this at the moment)


The natural ecosystem is C++

UE4 Wherever You Go: Bringing UE4 to Phones, Tablets & Web | GDC 2015 Event Coverage | Unreal Engine: https://www.youtube.com/watch?v=LqHjkX3etG0

Then you have emscripten and now WebGPU

Gamedev's ecosystem is C++, wasm + C++ matured thanks to emscripten, you don't need to port or rewrite anything, when you need to port something, then you can leverage the already existing ecosystem, Rust plays nice with WASM but is too young

Another evidence is Photoshop https://web.dev/ps-on-the-web/

Also wgpu is a rust library, WebGPU is the proper name

But yeah, the language doesn't really matter with WASM, most of the popular languages target it nowadays, so it's a matter of what's your favorite one, and what ecosystem you can leverage to achieve the result you want..


Agree that Unreal Engine is a powerful force. But it's not FOSS. While the licensing terms are attractive to gaming companies, I'm not sure how well that goes over in other sectors. In particular FAANG seems to prefer Apache/BSD or writing their own.


I think it’s because when WebGPU was being designed, a lot of rusties participated. Want to change the world? 90% of success is showing up.


The natural ecosystem is the browser.

There is Dawn for C++, also shipped alongside node.


Yes I agree, the natural ecosystem is webasm in the browser now that for the first time in history everyone has a good fast and general jit vm they can use. I'm surprised something like webasm didn't happen sooner but at least it is here now.


WebGPU doesn't have anything to do with WASM.

Anyone that wants to use it productively is also better off with BabylonJS, PlayCanvas, Threejs.


Yes I'm agreeing that the natural ecosystem of the browser is because of thing like webgpu and webasm now that it has been invented.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: