4 ms·
Zig is, however, unsuitable for interactive media or scientific computing due to the unfortunate lack of operator overloading (which is touted as a "feature"),
by banachtarski 7y ago
Zig is, however, unsuitable for interactive media or scientific computing due to the unfortunate lack of operator overloading (which is touted as a "feature"), rendering it less general purpose than I'd like.
Other aspects of its design look good however.
- olodus 7y agoIm not super sure what specific use case you are after but are you sure you can't do this in some ways with comptime generics? I have to be able to do most generic-like stuff with comptime (though I sometimes have to change the implementation a bit). I also really value how clear the lack of overloading makes the language. This way of clearly being able to follow the control flow is one of the things I like that they kept from C.
- banachtarski 7y agoYes I've tried zig a fair bit and the lack of operator overloading made the use untenable. The "ability to follow control flow" is, IMO, a silly argument. I will concede that `comptime` is a nice feature.
- dunkelheit 7y agoIt is obvious how operator overloading makes scientific computing easier but what about interactive media? Can you clarify?
- banachtarski 7y agoOh so like, dual quaternion skinning, spherical quanternion interpolation, matrix multiplication, vector sums, etc. I use a ton of linear algebra, vector algebra, and grassmann/clifford algebra at work and not having operators is like... why would I ever do that to myself. You end up in "parentheses" hell for things that would actually be nicely coded in concise and easy-to-understand expressions.
- ptrwis 7y agoYou can use syntax of the form vec1.add(vec2), which is still better than add(vec1, vec2)