News for hackers. Stuff that matters.
Re:Chrome Ships WebGPU by hutzlibu on Thursday April 06, 2023 @05:20AM (#35466095)
"ad-hoc shader language that kinda looks like, but is totally not rust."

But is that language actually bad, or is it just not your favourite language?

What don't you like about it?

Re:Chrome Ships WebGPU by adrian17 on Thursday April 06, 2023 @05:33AM (#35466181)
> What don't you like about it?

AFAIK: It's a mostly-but-not-100% textual equivalent of SPIR-V that, syntax-wise, is a weird hodgepodge of all the other shader languages. At the same time, it's rare it'll be actually written by hand by humans - it'll mostly be generated from another language at application build time, and then it'll have to be compiled back into bytecode by the browser, which feels like really redundant work.

Further, it's often said that the main reason the language exists in the first place is because Apple veto'd SPIR-V due to their legal disputes with Khronos. I'm assuming that's why the comment above called it "ad-hoc".

Re:Chrome Ships WebGPU by illiarian on Thursday April 06, 2023 @05:24AM (#35466121)
No idea what the comment about Rust means, but we already have several shader languages. There was literally no reason to invent another incompatible one
Re:Chrome Ships WebGPU by xchkr1337 on Thursday April 06, 2023 @06:06AM (#35466378)
Most current shader languages are very close to C in terms of syntax and behavior and these are some of the worst aspects of C as a language. I guess they could have went with SPIR-V but generally a compilation step shouldn't be required in web standards.
Re:Chrome Ships WebGPU by pjmlp on Friday April 07, 2023 @03:55AM (#35479277)
MSL, HLSL and PSSL are C++ dialects.
Re:Chrome Ships WebGPU by xchkr1337 on Friday April 07, 2023 @07:16AM (#35480425)
Literally all of these are owned by big corporations (Apple, Microsoft, Sony) and made specifically for their proprietary gpu APIs. C++ is just a superset of C which doesn't fix syntax problems. Making an open source standard with a modern syntax is a better idea than picking a favorite corporation.
Re:Chrome Ships WebGPU by pjmlp on Friday April 07, 2023 @07:25AM (#35480480)
Guess what is the main shading language used in Vulkan, specially going forward as announced at Vulkanised 2023.

C++ is a safer, more expressive superset of C89.

Also those dialects aren't C++, they are based in C++, which isn't the same.

Re:Chrome Ships WebGPU by enbugger on Thursday April 06, 2023 @05:45AM (#35466262)
Because it is too different from other C-like DSLs GLSL, HLSL. GLSL was doing its job perfectly and there was no reason to invent another one. With wgpu, I now need to spend time on searching through its reference pages for things that I already know how to do in shaders. Now all countless WebGL tutorials need to be migrated to completely new syntax. This could be much easier by just making a superset of GLSL. And I had't got any sane answer on "why it should look like Rust?"
Re:Chrome Ships WebGPU by mkl95 on Thursday April 06, 2023 @05:51AM (#35466296)
The language is called WGSL. It's not ad-hoc (I mean, all DSLs are to some extent?) and it has a pretty easy learning curve if you know GLSL. I don't get what the fuzz is about.
Re:Chrome Ships WebGPU by gardaani on Thursday April 06, 2023 @09:41AM (#35468188)
JavaScript is the programming language for the Web. WGSL syntax should have been based on JavaScript.