Every Language is Invented

Max Goldstein on 2015-10-19

“Most of you use languages that were invented, and you can tell, can’t you.” Nervous, genuine laughter ensues. Phillip Wadler continues, “This is my invitation to you to use programming languages that are discovered.”

So let’s accept, for the sake of argument, that the lambda calculus is discovered not invented. Wadler bases this point on the two other constructions, recursive functions and Turing machines, that are provably equivalent to it. Therefore, it’s not really the lambda calculus that is “omniversal,” as he says, but the logical system for which each of these provide an interface. By analogy, the command line and a GUI both provide an interface for the same file system.

It seems plausible that there are other interfaces that we haven’t discovered yet, and that aliens might prefer one of those instead. But there’s a much more concrete way in which the lambda calculus is invented, not discovered: notation. Aliens almost certainly won’t use the symbol lambda. Fine.

Notation becomes much more concerning when looking at a larger language like Haskell, which Wadler helped develop. Again let’s accept that its “core” like monads are a discovered logical entity. But did you have to go and call them monads, a name that means nothing to most people? Did you have to call the fundamental operation bind, a phrase that evokes handcuffs and leather straps, and give it a symbol unlike anything seen in a millennium of algebra? Did you have to call the other operation return, a name that worse than conveying nothing, is actively confusing to C-family programmers? Did you have to build the whole thing on so-called type classes and instances, when it’s much closer to subclasses or interfaces?

If monads are such a fundamental concept, shouldn’t there be words for them already? And if there aren’t, shouldn’t we be really careful when picking them?

It’s quite ironic to see Wadler’s slide listing academic papers by names and dates, those human and historical trappings, when he’s getting at a supposedly omnipresent idea. We don’t teach arithmetic by talking about abacuses and Roman numerals. An idea this powerful deserves to be written down in one place, with elegant notation, rather than cobbled together from different people, times, and fields of study.

None other than Guass introduced [x] as notation for the “greatest integer” function. A century and a half later, computer scientist Kenneth Iverson kept the meaning but added clarity: he erased the top horizontal bars and called it the floor function. (Medium won’t let me typeset it; I suppose Wadler is right about good ideas taking decades to be adopted.) The combination of name and symbol makes the meaning clear. The new notation also made a new discovery, the ceiling function, obvious.

Much like refactoring code, progress in mathematics and logic means simplifying and clarifying how we write abstract ideas. Every mathematical statement is written in language that is invented, or perhaps, designed.

There’s a moment in the talk where Wadler talks about the Voyager plaque.

His point is that the aliens would understand the mathematical perfection of binary and 3D coordinate space on the left, but be very confused by the “scribbles on the right that they cannot decipher”.

I want you to look at the image and relax your eyes for a few moments. What part do you find yourself looking at?

The people! Human vision is exceedingly good at seeing humans! We’re so good at it we see faces where there are none! The problem isn’t that there are no faces in space, it’s that there are too many!

Erik Naggum was a lisp programmer, that other side of functional programming that also claims to be perfect. Regarding how he works at his computer, he once wrote, “I’m profoundly uninterested in what user interface a novice user would prefer.”

Well, Mr. Wadler, I am profoundly uninterested in what programming language an alien would prefer. Just as I don’t measure distance in Planck lengths or speed as a fraction of c, I don’t want an omniversal language. I want a language that is designed for use by humans.

The notion that “it doesn’t matter how information is presented as long as it’s there” is poison. Function names matter. The order of functions in the docs matters. Examples matter.

Haskell docs are a mess because they tell you everything you might ever need to know, not what you need to know most commonly. I poked around and saw deprecated functions listed first, links to academic papers, and warnings about exceeding maxInt. I’m informed that the docs use big-O notation, and given a link to Wikipedia — as if people reading Haskell docs don’t know what big-O is. Meanwhile, a lot of the functions I actually want to use are implicit in the type instances, a case of abstraction gone horribly right.

Haskell is an invented language, and deep down, you know it.

Read More: Sure, Haskell is a Research Language