4 ms·
The Ada language requires explicit parentheses in the case of a succession of different logical operators precisely to avoid precedence-related bugs. [0] In t
by MaxBarraclough 3y ago
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.html http://archive.adaic.com/standards/83rat/html/ratl-03-06.htm...
[1] https://tutorial.ponylang.io/expressions/ops#precedence https://tutorial.ponylang.io/expressions/ops#precedence
[2] https://github.com/ziglang/zig/issues/114 https://github.com/ziglang/zig/issues/114
- pi-e-sigma 3y agoAda 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.
- MaxBarraclough 3y agoThe late arrival of a Free and Open Source compiler certainly didn't help its adoption in Free and Open Source circles.
- wruza 3y agoI 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.
- pi-e-sigma 3y agoCompare 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.
- MaxBarraclough 3y agoI 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 https://www.stroustrup.com/JSF-AV-rules.pdf
- amelius 3y agoWhat about using the same associative operator multiple times?
- MaxBarraclough 3y agoA + B + C is permitted in Ada. https://learn.adacore.com/courses/Ada_For_The_CPP_Java_Developer/chapters/04_Statements_Declarations_and_Control_Structures.html https://learn.adacore.com/courses/Ada_For_The_CPP_Java_Devel...
- MrBuddyCasino 3y agoIf 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).