3 ms·
I wish they had kept the c/c++ syntax style for WGSL, the rust syntax is just awful and alienating.
by archerx 4y ago
I wish they had kept the c/c++ syntax style for WGSL, the rust syntax is just awful and alienating.
- jeroenhd 4y agoI 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.
- archerx 4y agoI 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.
- FL33TW00D 4y agoNot if you're a rust programmer!
- archerx 4y agoThankfully I am not and never will be.
- hatuthecat 4y agoNot 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.
- archerx 4y ago> swift/kotlin/rust/typescrip I don't use any of these and because it just<does>