News for hackers. Stuff that matters.
Re:WebGPU Fundamentals by archerx on Saturday April 15, 2023 @10:55AM (#35581165)
I wish they had kept the c/c++ syntax style for WGSL, the rust syntax is just awful and alienating.
Re:WebGPU Fundamentals by jeroenhd on Saturday April 15, 2023 @11:26AM (#35581465)
I much prefer the new syntax. The C based shader languages always end up in some kind of uncanny valley where it looks like C and C++ but behaves completely differently.

It's not exactly Rust either, the @annotations aren't written like that in Rust for example.

The let-syntax is closer to Javascript with type annotations, so that makes more sense for web programming than doing C style variable definitions. Using let and var instead of let and cons is a bit of a weird choice, though.

Other than the variable definition syntax, this syntax may as well have been C++-based without all the verbose names that C++ likes to add to its namespaces. Shades will usually mostly be math code, though, so it shouldn't even matter all that much in practice.

Re:WebGPU Fundamentals by archerx on Sunday April 16, 2023 @02:09AM (#35587692)
I feel like they made a lot of weird choices like let being the new const, while still having constants, that won’t be confusing at all. While disappointing I will try and port over some of my webgl stuff and see how I feel about it.
Re:WebGPU Fundamentals by FL33TW00D on Saturday April 15, 2023 @12:39PM (#35582193)
Not if you're a rust programmer!
Re:WebGPU Fundamentals by archerx on Sunday April 16, 2023 @02:04AM (#35587673)
Thankfully I am not and never will be.
Re:WebGPU Fundamentals by hatuthecat on Saturday April 15, 2023 @03:51PM (#35583965)
Not sure how it remotely looks “awful and alienating”. It looks like basically every recent language to me (swift/kotlin/rust/typescript). I feel like you just saw something that has the same numeric type names as Rust and jumped to conclusions.
Re:WebGPU Fundamentals by archerx on Sunday April 16, 2023 @02:04AM (#35587671)
> swift/kotlin/rust/typescrip

I don't use any of these and because it just<does>