Live data from Hacker News

The Slang Shading Language

shader-slang.com

21–30 of 50 posts

Re: The Slang Shading Language

#21

[flagged]

...which is only a problem on Linux though (turns out that system-wide shared locations for headers and linker libraries are not a great idea). Most Slang users will probably be on Windows, and apart from that there's also most likely not much overlap with S-Lang users.

> Most Slang users will probably be on Windows

Okay, so I didn't know that, I just noticed that it is impossible to have a system-wide installation of both libraries…

Re: The Slang Shading Language

#22
post #4

I've been very impressed by Slang as an open source project. The development team is quick to respond to issues and review pull requests. It's clear from their repository and their presentations that they take Slang seriously as a user-facing project, not a research demo.

It isn't weird it started inside NV and folks from there are still working on the project.

[deleted]

Re: The Slang Shading Language

#24

I have to wonder how this fits in with other shader technologies that seem to have overlapping purposes. (There's Khronos' own Spir-V, SDL's SDLSL, Three's TSL, and WebGPU's WGSL) The reflection and automatic differentiation look interesting, I just wish I understood better what problems they're trying to solve. I actually think WebGPU/WGSL will and should become ubiquitous, though it's a shame it's not more C/GLSL-l…

IMHO Slang fixes two problems in one tool: - the frontend language is mostly compatible with HLSL, which is the defacto shader authoring standard in the gamedev industry - it compiles to the 'shader language/bytecode zoo' of the different 3D APIs (since recently even WGSL/WebGPU) So it lets you author your shaders in a single language that's already accepted by most of the industry, and target the various 3D APIs (D3…

In my very limited experience: In addition to cross-compiling, you want additional features that WGSL doesn't provide if you want to compose shaders, so you'd end up with a tool like naga-oil [1] or wesl anyways.

[1] https://github.com/bevyengine/naga_oil

Re: The Slang Shading Language

#25

I hope this becomes the standard way of writing shaders across all platforms. There is no compelling reason for having to use WGSL, HLSL, GLSL or Metal C++. Having one single feature-complete language is a huge QoL improvement.

I think there is a compelling reason to have WGSL as a separate language (but maybe not sufficiently compelling): WebGPU is a lowest common denominator which can only have features which are in the intersection of its target platforms, and so WGSL has no “dead syntax” to memorize. If the language spec says it’s there, you can use it, and you won’t find examples online of code that just won’t work in WebGPU because of missing features.

Of course, the f16 extension immediately weakens that, and demonstrates that this situation probably won’t last.

Re: The Slang Shading Language

#26

I hope this becomes the standard way of writing shaders across all platforms. There is no compelling reason for having to use WGSL, HLSL, GLSL or Metal C++. Having one single feature-complete language is a huge QoL improvement.

Nobody is using all these languages at the same time, anyone who targets all these platforms already has some mechanism to turn HLSL or GLSL (or whatever) into what the target platform needs. That's why Slang will have difficulty finding adoption, it's the N+1th solution to a problem that already has been solved N times.

Re: The Slang Shading Language

#27

I hope this becomes the standard way of writing shaders across all platforms. There is no compelling reason for having to use WGSL, HLSL, GLSL or Metal C++. Having one single feature-complete language is a huge QoL improvement.

I think there is a compelling reason to have WGSL as a separate language (but maybe not sufficiently compelling): WebGPU is a lowest common denominator which can only have features which are in the intersection of its target platforms, and so WGSL has no “dead syntax” to memorize. If the language spec says it’s there, you can use it, and you won’t find examples online of code that just won’t work in WebGPU because of…

It must not last, because any API that is the common denominator between 10 year old mobile SOCs and current year high end desktop GPUs is doomed to do injustice to either platform.

Re: The Slang Shading Language

#28

I hope this becomes the standard way of writing shaders across all platforms. There is no compelling reason for having to use WGSL, HLSL, GLSL or Metal C++. Having one single feature-complete language is a huge QoL improvement.

What is missing from GLSL?

Re: The Slang Shading Language

#29

Earlier quoted context omitted.

I think there is a compelling reason to have WGSL as a separate language (but maybe not sufficiently compelling): WebGPU is a lowest common denominator which can only have features which are in the intersection of its target platforms, and so WGSL has no “dead syntax” to memorize. If the language spec says it’s there, you can use it, and you won’t find examples online of code that just won’t work in WebGPU because of…

It must not last, because any API that is the common denominator between 10 year old mobile SOCs and current year high end desktop GPUs is doomed to do injustice to either platform.

The only way for it to last would be for browsers to compile into some kind of compatibility layer for newer GPU features on older hardware, but that’s probably going to be extremely tough to do in some cases without killing performance on the older platforms, particularly if those features relate to things like synchronization.
Post reply on HN