Unfortunately I'm a GPU programmer. C++-based CUDA/HIP is still the standard regardless of how much people would rather use Rust to program GPUs.

Who is stopping you? Is it an employment concern?

This question strikes me as somewhat obtuse, but I will attempt an answer:

NVIDIA and AMD.

These are only two GPU manufacturers of any significance. (Intel is also a player, but not a major one.)

They supply SDKs (drivers and libraries required for software development) for their products that support C and C++ and precious little else.

There have been attempts to reverse engineer the toolchains in Rust but as I understand it they are not yet mature.

Apple's Metal is C++ too. Like, actual, you can compile it with plain C++ compiler and a shim header.

The Zig group claims that Zig can interop with C based libraries w/o too much work. It's one of the reasons I'm digging into it now. But I don't know anything about CUDA and have only done trivial Zig<=>C tests (like my Zig code working with libpng) so far. Are their claims BS? Is Zig just not mature enough? Something else?

The CUDA/HIP APIs are mostly C-like APIs but are really C++ language extensions. e.g. you need triple angle brackets when calling a GPU kernel. The compiler turns that into placing the kernel onto the GPU and running it.

The GPU kernel code itself needs to be compiled and for CUDA that is done with the proprietary nvcc, which is clang-based. HIP is better because it's an open-source llvm backend/frontend but you'd still need to add GPU-specific support to zig/rust/whatever.

> you need triple angle brackets when calling a GPU kernel. The compiler turns that into placing the kernel onto the GPU and running it.

It all boils down to calling CUDA runtime or driver APIs. Compiler just sprinkles fairly trivial amount of syntactic sugar, and under-the-hood glue code. One can launch GPU kernel from a pure C source file compiled with gcc.

> The GPU kernel code itself needs to be compiled and for CUDA that is done with the proprietary nvcc, which is clang-based.

nvcc is not the only option. Clang itself can compile most of existing CUDA code just fine, and the rest usually needs minimal porting.

Also, nvcc is not based on clang. It may use it as the host compiler, but that's the extent of its involvement with clang. IIRC, their front-end used to be based on EDG.

> HIP is better because it's an open-source llvm backend/frontend

CUDA and HIP share most of the front-end code in clang, so CUDA compilation with clang shares the same benefits. What's missing is PTX to SASS assembler, which creates the actual GPU binary, and that part is proprietary to NVIDIA.

AFAIK PTX compilation is the bit that is not mature in the Rust CUDA ecosystem as well, because it has to be reverse engineered rather than simply translated.

I don't know really.

My guess is that Zig cannot be considered mature until someone has written an application in it that contains a Lisp interpreter. I'm banking on Ghostty. Your move MH ;)