Hacker News new | past | comments | ask | show | jobs | submit login

I wish they had kept the c/c++ syntax style for WGSL, the rust syntax is just awful and alienating.



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.


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.


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.


> swift/kotlin/rust/typescrip

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


Not if you're a rust programmer!


Thankfully I am not and never will be.




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

Search: