Re:Why Zig When There Is Already CPP, D, and Rust? (2017)
by dullgiulio on Monday October 15, 2018 @01:17AM
(#18217523)
That's not what parent said. You can express your maths as function calls.
Operator overloading is often misused and violates the principle of minimal surprise. You could even have side effects.
Still, type safety is totally possible. In Go, of your unit is Feet, you wrap your int into Feet and you cannot sum it with anything but feet. And that's all compile time, no cost.
Operator overloading is often misused and violates the principle of minimal surprise. You could even have side effects.
Still, type safety is totally possible. In Go, of your unit is Feet, you wrap your int into Feet and you cannot sum it with anything but feet. And that's all compile time, no cost.