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.
> ...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.
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)
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
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.
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.