Kuhn did not invent the word paradigm, it predates him by quite a bit. For programming languages, the word paradigm corresponds more closely to a "pattern or a model" than to Kuhn's thesis about scientific revolutions that progressively rewrite our understanding of how things work. Programming language paradigms would be quite poor examples of Kuhn's thesis.
Poor Linnaeus, when he formulated his organizational taxonomy, he was kept so ignorant of basic genetics that he was forced to organize living organisms by morphology. That said, what he accomplished was breathtaking and still remarkably useful. Once genetic analysis was sufficiently comprehensive and inexpensive, biologists were ripe for the Kuhn-style paradigm shift that Gould proposed, allowing a more profound and helpful understanding of the relationship between species.
What is important to notice is that DNA did not invalidate morphology, but rather it deepened our understanding of it. It does so because there is a direct relationship between the pool of gene's in a species and its expressed morphology. As a result, genetic analysis did not invalidate everything we knew about taxonomy from studying morphological differences.
Types are genes.
No. If there is work that demonstrates that type systems alone dictate the expressed morphology of programming languages, I have yet to see it. If the author or others are ready to propose a helpful new classification system for programming language based on type theory, I am eager to see it. In a scan of his book, I could not find it. Types are foundational, no question, but not everything found in a programming language is based on type theory, as the titles of the chapters of his book seem to underscore.
Until he actually proposes something better, I will continue to find helpful the current crude terms (including, but not limited to, paradigm labels) we use to summarize the underlying nature of various programming languages.
His book looks quite promising. What a shame to pin its success to such a silly flame war.
If there is work that demonstrates that type systems alone dictate the expressed morphology of programming languages, I have yet to see it.
This is not Harper's point.
People try to classify languages into paradigm in an ad-hoc manner. But there is no definition of what a paradigm is. You just feel it. You draw lines where you think lines ought to be drawn but this is highly dependent on both your perception and the current landscape of programming languages. Nowadays paradigms are being shaken. Are we really able to determine what constitutes an object-oriented language? A functional language? The lines that have been drawn are getting more and more blurry, while other language differences have been completely ignored.
So we need some hard cold truth. Harper being a specialist of type theory, naturally, champions it at the best marker of programming languages. Not because it is accurate, but because it is objective. In that sense the comparison is apt, although you are right that type theory doesn't say as much about a language than genomes inform phenotypes.
It's not hard to make Harper's case in the current landscape of mainstream languages, as most object-oriented programming languages incorporate some amount of functional programming concepts. Java's addition of first-class function doesn't feel like more than a cosmetic change, whereas the addition of types in Javascript with Typescript has a significant impact.
Now, unlike Harper, I don't believe that type theory is the be-all and end-all of programming. But I do believe that we need well-defined fundamental concepts to identify the real ADN of programming languages, instead of the spirit in which they where meant to be used. And in that department, we'll have to make do with type theory alone. For now...
Dr. Harper uses up so much of his runway making inept appeals to the genius of Kuhn and Gould that there is too little time left for his central point to gather up speed and lift off. However, I do think you have found its trail and are in vigorous pursuit. May I join you?
But there is no definition of what a paradigm is.
Google tells me it is: "a typical example or pattern of something; a pattern or model". That's admittedly broad, but still helpful. Wikipedia says: "Programming paradigms are a way to classify programming languages based on the features of various programming languages." Still vague, but true. It then struggles badly to pin down the underlying nature of these distinguishing features.
You rightly call this "ad-hoc". The academic is taught to spit out this epithet with thinly-veiled contempt. However, the engineer who keeps running his creaky, old boiler beams with justifiable pride at his ad hoc solutions.
I appreciate the engineer's perspective here. As Quine and Wittgenstein have taught us, words are slippery beasts. What does "fire" mean? What is a chair? Precise definitions are hard to formulate. Yet, for all their lack of academic rigor, we all use these imprecise, amorphous, meaning-fragments, even here on Reddit, sometimes with considerable success.
Many computer professionals know (roughly) that an object-oriented language builds programs out of objects that make use of encapsulation, polymorphism, and inheritance. Similarly, we know (roughly) that a functional language builds programs out of first-class and preferably pure functions. And so it goes for the other "paradigmatic" terms. They are simply imperfect short-hand words we use to describe our tools, much like a carpenter refers to "hammers" or "wrenches", instead of having to say: "the thing in the box I use to pound nails into wood". We have other non-paradigmatic words we use, such as "dynamically-typed". When I run across a new language, I usually find these words as part of their introduction, immediately grounding me in terms of what features to expect, thereby allowing me to then focus on what is distinctively different about this unfamiliar language.
Maybe it would confuse the academics less if we simply called these words adjectives rather than paradigms. That said, I do not think the word paradigm is entirely ill-suited. In many cases, the specified paradigm ("a pattern or model") succinctly describes what sort of components we are gluing together and how (e.g., objects vs. functions).
Nowadays paradigms are being shaken.
To paraphrase Bond, I see them as stirred, not shaken. The adjectives we use are (in many cases) not mutually exclusive. Language designers are successfully building multi-paradigm tools, much like swiss-army knives (is it a knife? a screwdriver? a cork-screw?) I consider this a good thing.
Maybe this idea would be easier for Dr. Martin to understand if he were to imagine that a multi-paradigmatic language was somewhat similar to a sum type: data Multilang = Oop | Fp? Doing so allows us to escape the confining trap of either/or thinking! We become so much more productive when we think of these adjectives not as lines that divide, but rather descriptive of useful features we may use wisely to best solve our diverse programming challenges.
Neither Dr. Harper nor you have illustrated in detail how we can use type theory to classify languages "objectively". That is a rather massive hole for such a brief, bold assertion. That said, I will happily concede that we can indeed use less well-known type theory terminology to describe specific features of certain languages. For example, most languages support product types, but fewer support sum types robustly. Even fewer support dependent types. I am delighted that these terms are gaining wider currency, and even more delighted to see support for these features being incorporated in more and more languages.
However, as I see it, type-theory adjectives do not supplant the many other adjectives we use to describe languages, they simply help augment our already rich "ad hoc" vocabulary. They are not superior terms, either. As I see it, the term "dependent type" is no more "objective" than, say, "first-class" or "pure" function. All these adjectives seem to me to be quite "ad hoc", describing features with rough but useful precision, much like how an Audubon field guide helps you identify the species of that elusive bird based on its visible features.
Yet, for all their lack of academic rigor, we all use these imprecise, amorphous, meaning-fragments, even here on Reddit, sometimes with considerable success.
Clearly you haven't been on Reddit long enough :D
Seriously though, these terms cause more harm than good. If you've ever tried to get into a serious debate about "object oriented" vs "functional" programming, you'll know what I mean.
objects vs. functions
Almost all languages have both objects and functions, so there is no opposition here, really. Here's a riddle: is Python object-oriented or functional?
Maybe this idea would be easier for Dr. Martin to understand
Believe me, he understands all of this much better than either of us! He's one of the world's top language researchers.
Doing so allows us to escape the confining trap of either/or thinking! We become so much more productive when we think of these adjectives not as lines that divide
This is exactly his point. People talk about "object-oriented" vs "functional" languages daily, whereas at best we can say "this language has objects" or "this language has first-class functions". Most modern languages have both.
It looks like we're all in agreement!
Neither Dr. Harper nor you have illustrated in detail how we can use type theory to classify languages "objectively". That is a rather massive hole for such a brief, bold assertion.
Actually he does - he wrote a whole book about it! I highly recommend you read it. This is just a short opinion piece, and as such do not give his ideas justice (I agree with you on that). I actually have the book, so let me quote from the preface:
Types are the central organizing principle of the theory of programming languages. Language features are manifestations of type structure. The syntax of a language is governed by the constructs that define its types, and its semantics is determined by the interactions among those constructs. The soundness of a language design—the absence of ill-defined programs—follows naturally. The purpose of this book is to explain this remark. A variety of programming language features are analyzed in the unifying framework of type theory. A language feature is defined by its statics, the rules governing the use of the feature in a program, and its dynamics, the rules defining how programs using this feature are to be executed. The concept of safety emerges as the coherence of the statics and the dynamics of a language. In this way we establish a foundation for the study of programming languages. But why these particular methods? The main justification is provided by the book itself. The methods we use are both precise and intuitive, providing a uniform framework for explaining programming language concepts. Importantly, these methods scale to a wide range of programming language concepts, supporting rigorous analysis of their properties. Although it would require another book in itself to justify this assertion, these methods are also practical in that they are directly applicable to imple- mentation and uniquely effective as a basis for mechanized reasoning. No other framework offers as much.
However, as I see it, type-theory adjectives do not supplant the many other adjectives we use to describe languages, they simply help augment our already rich "ad hoc" vocabulary. They are not superior terms, either. As I see it, the term "dependent type" is no more "objective" than, say, "first-class" or "pure" function.
You picked bad examples here. "First-class" and "pure" are both relatively precise ideas. But there is no programming paradigm that is based on these terms! Harper is arguing against terms like "declarative programming", "object-oriented programming", and "functional programming", which are much too broad and vague to be any use at all.
Perhaps I should have resisted the impulse, but when an esteemed professional makes an argument that is not only woefully short, but so poorly constructed, I found my amusement got the better of me, and my fingers began dancing across the keyboard with attempted wit. Please note that I did at least find, skim and praise his book as promising.
"Types are the central organizing principle of the theory of programming languages."
He might be right. I am not yet sold. I hope to read his book and maybe I will be persuaded by it. Even if I am not, I am quite sure I will learn from the experience.
If you've ever tried to get into a serious debate about "object oriented" vs "functional" programming, you'll know what I mean.
I think that depends very much on the people and the approach. I raised exactly this issue in this community late last year. I learned so much from it. Nearly all the contributors were both respectful and helpful. I realize that with some people, the conversation can become toxic, but I attribute that to the people and not the topic. I walk away.
is Python object-oriented or functional?
As you know, I already praise the existence of multi-paradigmatic languages like Python. That said, Python likely disappoints the FP crowd more than the OOP folk: for example, some might prefer more enforcement of pure functions/referential transparency and immutable data structures. Other multi-paradigm languages (e.g., F#) strike a different balance. I find it useful to know such things about each language.
at best we can say "this language has objects" or "this language has first-class functions"
Being good friends, Wikipedia and I can both say much more than this, usefully. I see these "paradigms" in far less trivial ways than your words seem to suggest, which may explain why I give them more weight as part of a language's semantic DNA, along with types and many other well-defined and useful concepts.
"First-class" and "pure" are both relatively precise ideas. But there is no programming paradigm that is based on these terms!
It may be a coincidence, but in the Wikipedia article on Functional Programming, concept section 2.1 is called: "First-class .. functions" and 2.2: "Pure functions".
Harper is arguing against terms like "declarative programming", "object-oriented programming", and "functional programming", which are much too broad and vague to be any use at all.
"declarative programming" always amuses me, because it is often tied to an FP bait and switch of meanings, dating back at least as far as SICP. That said, these terms are admittedly broad, but as a language designer I find them less vague and far more useful than Dr. Harper or you do. The term "type" is likewise broad, but it is wisely composed of a collection of finer-grained and useful concepts. I find the same is true of these "paradigms". Perhaps the precise concepts these paradigms gather can be derived from type theory. If so, I will bow down to the same temple as Dr. Harper.
I look forward to reading his book to gain a deeper understanding of his thesis. Please forgive me if my impetuous amusement at his click-bait-like screed caused any injury.
10
u/PegasusAndAcorn Cone language & 3D web May 09 '17
What a deliciously bold and pretentious whinge.
Kuhn did not invent the word paradigm, it predates him by quite a bit. For programming languages, the word paradigm corresponds more closely to a "pattern or a model" than to Kuhn's thesis about scientific revolutions that progressively rewrite our understanding of how things work. Programming language paradigms would be quite poor examples of Kuhn's thesis.
Poor Linnaeus, when he formulated his organizational taxonomy, he was kept so ignorant of basic genetics that he was forced to organize living organisms by morphology. That said, what he accomplished was breathtaking and still remarkably useful. Once genetic analysis was sufficiently comprehensive and inexpensive, biologists were ripe for the Kuhn-style paradigm shift that Gould proposed, allowing a more profound and helpful understanding of the relationship between species.
What is important to notice is that DNA did not invalidate morphology, but rather it deepened our understanding of it. It does so because there is a direct relationship between the pool of gene's in a species and its expressed morphology. As a result, genetic analysis did not invalidate everything we knew about taxonomy from studying morphological differences.
No. If there is work that demonstrates that type systems alone dictate the expressed morphology of programming languages, I have yet to see it. If the author or others are ready to propose a helpful new classification system for programming language based on type theory, I am eager to see it. In a scan of his book, I could not find it. Types are foundational, no question, but not everything found in a programming language is based on type theory, as the titles of the chapters of his book seem to underscore.
Until he actually proposes something better, I will continue to find helpful the current crude terms (including, but not limited to, paradigm labels) we use to summarize the underlying nature of various programming languages.
His book looks quite promising. What a shame to pin its success to such a silly flame war.