On Constructed Languages, Computer Languages, and Their Grammar Complexity
today's twitter extempore!
- xah's edu corner, on constructed languages and comp languages, and their grammar.
- in english, french, chinese, arabic, all human languages have very complex grammar. It's difficult to learn.
- many tried to remedy this. In almost all constructed lang, esperanto, lojban, etc, have simple grammar.
- but strange, in computer lang, almost all have ad hoc, irregular grammar. C and all C derived syntax, does not try to make it simple.
- The concept, of a simple grammar, doesn't exist in average programers's minds.
- golang's syntax, derived from C, created its own ad hoc syntax.
- There are some languages that have simple grammar. lisp, Wolfram Language, APL, XML, tcl.
- but the quality of simple syntax, does not seem to be appreciated. The trend is more complex syntax.
- xml, the concept is simple. gets more and more complex by spec, till html5 killed it. html5 actively encourages irregular grammar
- lisp, when invented, was the first language to espouse simple grammar. But today's lispers don't understand none of it.
- racket, clojure, both created incomprehensible syntax, especially clojure. [see Clojure: Magic Characters ' \ @ ^ # ` ~ .]
- haskell, great functional programing language, based its syntax on one man's whim — ISWIM.
- syntax become complex, seems to spur from evolution, basically: habit and familiarity. Just like natural human language, eg english etc.
- no foundational thought. Probably partly cuz, lang with unfamiliar syntax have little chance of survival. people no want learn.
- and perhaps for the same reason, all reform of english, failed, and no constructed language, despite simplicity, are really used.
- there were tens of english reforms, some had some limelight at their time, but all are eventually buried in history.
- so, habit and familiarity are fundamental in human activities.
- though, not to say that computer language with simple grammar will disappear.
- lisp, Wolfram Language, XML, APL, not gonna go away anytime soon. Especially their concept.
- and my hope is that, newer langs will be based on syntax algebra.
If you have a question, put $5 at patreon and message me.