News for hackers. Stuff that matters.
Re:Zig Structs of Arrays (2024) by fluffybucktsnek on Monday June 08, 2026 @06:50PM (#48453493)
I don't see how it is unrelated. If have a custom type `A` with an overload on `+`, it will only affect places I used custom type `A`. If there wasn't operator overloading, I would just have to use a different notation to call the same function, but with possibly worse ergonomics (which is also why I think your solution doesn't really satisfy that, it doesn't read like algebra which is kind of the point). Given that type A is presumed to be custom, I don't see how place Y would be unrelated since it deliberately uses type `A`.

If we include operator overloading for any types, then sure. i32 + i32 might suddenly start meaning something else. But I think that's beyond the scope of what is normally asked by operator overloading.

Re:Zig Structs of Arrays (2024) by dnautics on Monday June 08, 2026 @08:57PM (#48454741)
one is implementable entirely in the parser. overloading (operator or otherwise) in general is a deeper compiler feature