2022-08-09, updated: 2022-08-11
Tested with Nyxt 3.0.0.
Many amateur programmers assume that any programming language always falls into one of two categories. These categories and languages vary across culture and domain. Some of them are: serious languages versus toy languages, compiled versus interpreted, domain specific versus general. However these dichotomies may manifest, they all share one trait: an insidious innuendo that some languages are superior to others.
At first, this notion may seem perfectly reasonable. Certainly we can agree that not all languages are equal- right? However, can we say which languages are superior? Can we define an objective metric of superiority? Regardless of whether we can, many of us will not hesitate to use such classifications as a cudgel to beat our fellow programmers. "Oh, you work with HTML? You're not a real programmer". As a result, this line of reasoning is rather dishonest. We are not really interested in which languages are superior, but rather in demonstrating our own superiority.
In light of this egregious behavior, we'll attempt to dismantle the most famous dichotomy of all, Osterhout's Dichotomy 1.
That said, I'll step off my high horse now, and I'll tell you why Lisp is the superior language /s.
Castor and Pollux - Robert Fagan (1793 - 1795) 2
The world through Osterhout's eyes
According to John Osterhout 3 there exist two language types: system languages, and scripting languages.
- statically typed
- support complex data structures
- compile into machine code
- typed dynamically
- little or no provision for complex data structures
- are interpreted
However, are there not many exceptions to this rule? Well, of course there are. Even when Osterhout first coined this term in 1988 there were exceptions to the rule. No good rule is a rule without a good amount of exceptions. "I" before "E" except after "C" 4.
Even at first glance the classification is nonsense. Is Python not an interpreted language with support for complex data structures? Is Python really an interpreted language? What about Java? Does the JVM count as an interpreter?
An inherent confusion between implementation and language
It is likely that this foolish dichotomy perpetuates because of the conflation between language and implementation.
If we consider that a language is not an implementation, Osterhout's dichotomy should state that there are system compilers and scripting interpreters. These are however entirely orthogonal to a language's implementation insofar as the language does not specify implementation details which deliberately force the hand of the implementer to implement a compiler or an interpreter. In other words: a language is not inherently compiled or interpreted.
This point is well explained by a StackExchange user Jörg W Mittag:
There is no such thing as an interpreted statically typed language, simply because there is no such thing as an interpreted language, period. Interpretation and compilation are traits of the, well, interpreter or compiler (duh!), i.e. the implementation, not the language. Every language can be implemented with an interpreter and every language can be implemented with a compiler. In fact, many languages have both interpreted and compiled implementations. For example, Haskell has several compiled implementations (Ghc, Jhc, Yhc, Lhv) and an interpreted implementation (Hugs). ECMAScript has pure compiled implementations (V8), and hybrid mixed-mode implementations (e.g. SpiderMonkey AOT-compiles ECMAScript to SpiderMonkey bytecode, then both compiles and interprets this bytecode)
Saying that a language is an "interpreted language" is not just wrong, it is even more than wrong, it is simply non-sensical. The idea of "language" and the idea of "interpretation" live on two different levels of abstraction. If English were a typed language, "interpreted language" would be a type error.
This may seem like splitting hairs, however it is the crux of our argument. A language is not an implementation! Furthermore a language often can, and does have several implementations- some compiled, some interpreted.
Why couldn't Lisp be a system language?
This leads us to our final point. By Osterhout's erroneous dichotomy, can Lisp be classified as a system language? Well, kind of. Lisp is gradually typed 5, can be interpreted and/or compiled (with present day implementations), and it definitely supports complex data structures.
Therefore, if Lisp is a system language, can we make an operating system using it? Why yes, yes we can! Case study: Mezzano. We don't need to sail the C, we've got entire galaxies to explore (using alien technology, of course6)!
We can use all the magic of Lisp all the way down! Imagine such a world, close your eyes. Symbolics still exists. We're riding on hovercars. All of the promise of yesteryear's tomorrow actually comes to fruition. The world is at peace, a literal utopia. One can only dream…
Thanks for reading!
Castor and Pollux are known as the Dioscuri, or in Latin, the Gemini. Twins are often confused with one another, therefore it seemed apt to include them here. https://en.wikipedia.org/wiki/Castor_and_Pollux↩
Did you enjoy this article? Register for our newsletter to receive the latest hacker news from the world of Lisp and browsers!
- Maximum one email per month
- Unsubscribe at any time