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

> Vulkan GLSL is the appropriate language to start with.

GLSL is ABSOLUTELY NOT an appropriate language to start with anymore for a huge number of reasons, and I dearly wish people would quit using it for tutorials.

Anyone trying to get into GPU programming is going to be much, much more familiar programming in Slang which is effectively HLSL plus some stuff and HLSL is superficially like C++. As a bonus, you are learning a shader language actually used on Windows.



The caveats: Slang is a transpiled language so you're putting in extra abstraction layers, and there's a difference between what people commonly use for GPU programming in games/graphics vs general compute apps. For example people on AMD chips seem to be gravitating to Vulkan for LLM stuff now and Slang/HLSL are not involved.


Slang compiles directly to SPIR-V which is now directly supported by both DirectX (as of Shader Model 7) and Vulkan (from the very beginning). Where is the transpilation or abstraction?

> For example people on AMD chips seem to be gravitating to Vulkan for LLM stuff now and Slang/HLSL are not involved.

You seem to be confusing different layers of the graphics stack. The SDK operates on the host CPU but the GPU needs something else. For Windows, that was DirectX (CPU) with HLSL compiled to DXIL (GPU). For Linux/Android, that was Vulkan (CPU) with GLSL compiled to SPIR-V (GPU).

As of now, those are DirectX with (HLSL or Slang) to SPIR-V and Vulkan with Slang to SPIR-V.

Microsoft announcement of support for SPIR-V in SM7: https://devblogs.microsoft.com/directx/directx-adopting-spir...

Vulkan announcement of Slang as supported shading language: https://www.khronos.org/news/press/khronos-group-launches-sl... . You can also see it in the fact that the Vulkan examples now all have slang shaders as well.

The biggest reason to quit using GLSL is simply that development of it occurs at a snail's pace relative to the others because Microsoft and NVIDIA pour so much resource at HLSL and Slang, respectively.


Ok, I had the wrong idea (or out of date?) about Slang, thanks for the correction.


Agreed. I wish it was easier to embed the compiler in my favorite languages and reflect on it. Quite excited bout Wesl: https://github.com/wgsl-tooling-wg/wesl-rs.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: