3 ms·
Zig is becoming a real do-everything tool for me. I was learning gpu programming recently and found you could compile it to SPIR-V!
by conorbergin 1y ago
Zig is becoming a real do-everything tool for me. I was learning gpu programming recently and found you could compile it to SPIR-V!
- AndyKelley 1y agoOh yeah, everyone is sleeping on this use case. Plenty of work to go before we can advise people to try it out yet, but being able to share packed structs, enums, and compile-time logic across CPU and GPU code is going to be, quite literally, a game changer.
- andyfleming 1y agoIs that similar to the functionality they're targeting with Mojo?
- sgt 1y agoForgive my ignorance but what would be some practical use cases for this, for someone who hasn't been doing any GPU programming to understand? I guess Machine Learning?
- wiz21c 1y agocurrently, when you want to write a sahder, you have to use a specific language for that (gl/sl or some other). That's a pain because that language is C-like and most likely pretty close to your host language (C,Rust,Zig whatever). Moreover, you must pass information to these shaders (uniforms) and it means you have to write code to copy from you haost lang data structures to the data strctures of the shaders (which , once again, are pretty close to those in your host language). Shader languages don't usually have "import" mechanism, so building with them is painful. And their syntax is very light, so having syntactic sugar coming from the host language would be cool. So yeah, writing shader in something else than Gl/SL, wgsl would make our life so much easier...
- miki123211 1y agoIs this just for graphics programming, or are ML / scientific computing use cases (compiling to Cuda / SASS) considered too?