7 ms·
Knowledge of English is nowhere near as widespread as knowledge of infix notation. If we were to create a programming language based on words from a natural lan
by GrumpySloth 3y ago
Knowledge of English is nowhere near as widespread as knowledge of infix notation. If we were to create a programming language based on words from a natural language which is most likely known by people trying to learn (i.e. most of them are in the age bracket 10-20), it would need to be Mandarin Chinese, since it’s the most popular first language. Even then it covers only 1/8 of the world population. Comparing it to infix notation is unjustified. To the rest of the population keywords in this language would at first be even less comprehensible than APL. Later they would be just as comprehensible as C is today. English is not known by most people learning programming, and yet it’s not a real problem. Even English-speaking people don’t seem to have an issue with the for loop, even though its name has nothing to do with any meaning of “for”.
But let’s now take something that is actually widespread: angular degrees. Before high school, I used only degrees at school and everywhere else. In high school I was taught about radians. Radians are a lot less used by random people than degrees. But since I learned them, as I later went through uni, then job etc, I’ve completely stopped thinking in degrees and use only radians, both professionally and in everyday life. That’s because their benefits justify the switch. So even when something is actually widespread, we can still find good reasons to switch to something that provides material benefits. I claim that the notation of array languages is beneficial enough (at least in the case of BQN).
As for Lisp:
1) Most languages offer a hash table as the default associative data structure. In Lisp culture alists are the default. Books about lisp also focus pn data structures built out of cons cells disproportionally more than any other data structures.
2) They do. But then you read actual programs available on the web and they still default to using alists. There is an impedance mismatch, if you’re more array/stack/hashtable-minded, which isn’t there in most mainstream languages. FTR I’m a big fan of SML too, but even in SML using the best data structures is very much going against the grain, when the language tries to steer you so much towards linked lists and away from arrays. I swear my SML programs look nothing like the things I find on GitHub.
- mschaef 3y ago> 2) They do. But then you read actual programs available on the web and they still default to using alists. I was wondering how true this was, so I checked Planet Lisp. The first article is an admonition to use structures and classes _instead_ of alists, and it's followed by a bunch of other articles that use instances, structures, and hash tables. No a-lists to be found. I've used Lisp (mainly Clojure, but others also) and I don't even remember the last time I used an a-list, outside of maybe Emacs Lisp. As you point out, they're a mostly dumb idea in an age where there are better data structures and memory hierarchies are multi-leveled and often packet switched. I'll agree with you that it has been part of the Lisp culture, but that's the Lisp culture of the 70's and 80's. The language has moved on.