Re:We need to talk about parentheses
by kragen on Monday February 12, 2024 @07:16AM
(#39343989)
programmers a choosing a language because of syntax are like house buyers choosing a house because of the color it's painted
[ Parent
| on HN ]
Re:We need to talk about parentheses
by lex-lightning on Monday February 12, 2024 @08:03AM
(#39344314)
But what if the two houses are otherwise identical? Even a small convenience will tip decisionmaking
in cases similar to that, it would be a reasonable thing to do
I'd like to think I'd have a far easier time painting a mauve house ochre than I'd have trying to change Rust to have an S-expression syntax (not in the least because I have the programming chops of a slightly dimwitted housefly).
it's an excellent point: non-programmers choosing a programming language would do well to pick a language whose syntax they like, since they can't change it
Re:We need to talk about parentheses
by erik_seaberg on Monday February 12, 2024 @03:58PM
(#39350406)
The wrong paint won’t stop you from adding a garage, but choosing a complex and non-uniform syntax makes it so hard for end users to extend the language that we almost never try. Imagine how much more readable Java would be if Lombok didn’t need to smuggle each option in a prefix @Annotation.
if running your java through m4 before you compiled it is a major advantage, doing it is trivial. compiling from a completely different surface syntax is a little more work but still not life-changing
Re:We need to talk about parentheses
by erik_seaberg on Wednesday February 14, 2024 @05:58PM
(#39376779)
The hard part is parsing Java’s grammar with your extensions, and then validly altering a complex AST with many different types of statements and declarations. That’s the only way to make your work read like Java, and why Lombok doesn’t.
I seem to recall some fellow or other describing notation as a tool of thought.
That doesn't sound superficial to me.
that was iverson, explaining the motivation for apl. you may have noticed that apl-like notations have not supplanted algol-like notations like c, python, golang, lua, and scheme for programming in the way that arabic numerals have supplanted roman numerals and algebraic formulas have supplanted geometric diagrams and natural-language arguments. the apl data model is very popular in some application areas (numpy, r, and tensorflow are based on it) but the notation is not. today apl, j, and k are less popular than haskell
to me, this indicates that iverson was mistaken: apl users did not gain major cognitive advantages over users of programming languages with more conventional syntax, so language choice has been driven by other factors. the same cannot be said about programming language choice in general; writing things in assembly language clearly takes much longer than writing them in c, python, golang, lua, scheme, or basic. but that turns out to be a result of their different data models, not different syntax