News for hackers. Stuff that matters.
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by MaxBarraclough on Friday January 05, 2024 @06:40PM (#38886613)
The Ada language requires explicit parentheses in the case of a succession of different logical operators precisely to avoid precedence-related bugs. [0]

In the Pony language, any expression where more than one infix operator is used must use parentheses to remove the ambiguity. [1]

The Zig language considered following Pony, but didn't. [2]

[0] http://archive.adaic.com/standards/83rat/html/ratl-03-06.htm...

[1] https://tutorial.ponylang.io/expressions/ops#precedence

[2] https://github.com/ziglang/zig/issues/114

Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by pi-e-sigma on Friday January 05, 2024 @06:43PM (#38886643)
Ada is such an underrated language. The lack of its adoption is a testament to the old adage that technologies don't thrive or die on their technical merits.
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by MaxBarraclough on Saturday January 06, 2024 @06:46AM (#38890640)
The late arrival of a Free and Open Source compiler certainly didn't help its adoption in Free and Open Source circles.
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by wruza on Saturday January 06, 2024 @10:42AM (#38892309)
I remember reading a discussion on it in a year around <= 2000 and it was a general consensus that Ada’s printed standard is too heavy to move around, let alone implement. Military/corporate-ish affinity didn’t help either.
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by MaxBarraclough on Saturday January 06, 2024 @12:18PM (#38893201)
I see pi-e-sigma beat me to it, but:

C++ is at least as complicated as Ada, both in terms of using the language and in terms of writing a compiler for it.

C++ also sees plenty of use in military applications. The F-35's 141 page C++ coding standard is publicly available, for instance.

https://www.stroustrup.com/JSF-AV-rules.pdf

Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by pi-e-sigma on Saturday January 06, 2024 @12:07PM (#38893077)
Compare C++ and Ada. C++ standard is an order of magnitude bigger and more complex and yet C++ is thriving. So Ada's failure definitively is not due to the language complexity. C++ has been supported heavily by the corporate, too. Biggest C++ champion was Microsoft, after all.
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by amelius on Friday January 05, 2024 @07:24PM (#38886931)
What about using the same associative operator multiple times?
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by MaxBarraclough on Saturday January 06, 2024 @06:43AM (#38890627)
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by MrBuddyCasino on Saturday January 06, 2024 @07:04AM (#38890760)
If I read this right, Zig follows Pony partially. The very basic stuff like addition and multiplication follows the well known precedence rules („chainable“), but eg bitwise operators whose precedence nobody can remember must be put into parentheses.

I find this a good compromise between being explicit and readability (Lisp syndrome).