‹ BackHN Continuity

Thread

Nvidia announces native GPU programming in Rust

970 points · 404 comments · nonmaskable

  1. jacobgorm · · focus · HN ↗
    I strongly dislike CUDA. Once you have allowed that proprietary cr*p into your C++ codebase, it is very hard to get rid, and you end up with code that is either tied to a single vendor or an #ifdef hell, probably both.

    The best way to program GPUs is face up to the reality that they are not the same machine as the CPU, write your kernels in separate files, and launch them manually, like in Metal, OpenCL, and D3D12, etc. These days we even have DSLs like Triton that make kernel writing much more ergonomic than anything you would hope to achieve in Rust.

    1. fg137 · · focus · HN ↗
      > Once you have allowed that proprietary cr*p into your C++ codebase

      People have been doing that all the time for every kind of codebase. It's just part of the business. I don't see how it's worth having any emotions or opinions about it. Seems like you are wasting your energy.

      Are win32 APIs proprietary? So you decide to use them, use a wrapper/UI framework, or don't develop for Windows. Easy choice.

      Developing for embedded devices? So you read the manufacturers manual and implement based on the spec, use some sort of HAL if they are available, or you don't have a job. Even simpler.

      1. worik · · focus · HN ↗
        > Are win32 APIs proprietary?

        Yes. And crap. Not in my code bases.

        1. josephg · · focus · HN ↗
          If you're going to make apps in windows, you need to call their proprietary API somehow. Maybe you do it via a wrapper library, or via electron or something. But that's the same thing, just with more indirection.
          1. worik · · focus · HN ↗
            > If you're going to make apps in windows

            ...your troubles are starting

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.