News for hackers. Stuff that matters.
Re:Why Zig when there is already C++, D, and Rust? by pharmakom on Saturday January 16, 2021 @04:46AM (#25801226)
I don't understand this benefit. so in zig we are trusted to manage memory but we can't be trusted to overload operators in a sensible way?
Re:Why Zig when there is already C++, D, and Rust? by generichuman on Saturday January 16, 2021 @06:08AM (#25801524)
The benefit is that you don't have to be concerned about hidden function calls. You don't get unexpected function calls or performance hits this way.

If you want your code to run fast, you need to ensure that you know what your program is doing and you're in control, at all times. Manual memory management enables that.

Re:Why Zig when there is already C++, D, and Rust? by pharmakom on Saturday January 16, 2021 @09:58AM (#25802573)
... but operator overload is not really different to function overloading, it's just that the function name is infix rather than prefix.
Re:Why Zig when there is already C++, D, and Rust? by jorangreef on Saturday January 16, 2021 @06:05AM (#25801516)
I believe the rationale against operator overloading is not a question of whether the programmer should or shouldn't be trusted, but rather simply about optimizing for code readability.
Re:Why Zig when there is already C++, D, and Rust? by pjmlp on Monday January 18, 2021 @05:55AM (#25820439)
Then better integrate some static analysis with natural grammar knowledge to ensure all functions are properly named for their actual purpose.