If not, why is it?

What delineates the difference between the study of language and the study of programming languages?

Programming languages define syntax and semantics of code. Does this mean programming languages are a subset of languages?

Does the question of programing language being a subset of linguistics even make sense?


4 Answers 4


Linguistics, as normally understood in the scientific community, is not the study of language, but the study of natural language. As such, programming languages are not part of linguistics.

There is a more general framework of formal language theory in mathematics that can (at least to some degree) account for the syntax of both natural languages and programming languages. Though note that this approach presupposes that the syntax of natural languages can be treated as a formal language, which already is somewhat questionable. The key concept of classical formal language theory is that of a "recursive grammar"; it may be that there are also other, less well-known (because less successful?) general language syntax frameworks around. This may be simply called "language theory", as opposed to "linguistics".

However, since natural and programming languages are fundamentally different in their nature w.r.t. to their semantics -- one is a means of inter-human communication of facts (and queries, references to individual objects, ...) of the real world, the other is designed for compututation of digitally represented data -- there is (to my knowledge) no universal semantic theory that gives a non-trivial unified account of both natural and programming language semantics.

  • I think the notion of linguistics dealing strictly with "natural" language is a bit misleading, it kind of doesn't fit too well with theoretical concepts like reconstructions or constructed languages. One might argue these aren't real languages, but that hasn't stopped linguists from getting their hands dirty has it? Commented Mar 2, 2020 at 9:17
  • While I agree that formalism is a crucial difference between natural language and computer language, I feel like the division between the communication of facts versus data is a vague and artificial division. A fundamental purpose of both natural and computer language seems to be the transmission of information whether facts, data, opinions, or otherwise. Commented Mar 2, 2020 at 22:49

"Does the question of programing language being a subset of linguistics even make sense?"

Yes, it does. The programmers doing the programming all speak natural language. Can anyone imagine devising a computer program if you don't already speak some natural language? Why do both human languages and human languages share the hierarchical structure seen in both?

It's because computer languages have been constructed in imitation of human language. Of course, computer languages are subsets of human language. How else could they have arisen?

  • While this might be true, there are completely different criteria for programming languages than for natural languages!
    – csabinho
    Commented Feb 26, 2020 at 0:24
  • 1
    If your answer is yes because computer languages are human languages, then you seem to be presupposing that either linguistics = the study of human-made (not: natural) languages or that human languages = natural languages, but this is already disputed for constructed languages like Esperanto, and certainly even more so for programming languages. Commented Feb 26, 2020 at 0:26
  • @lemontree But I didn't give the reason "because computer languages are human languages". I said that computer languages were devised in imitation of human languages, which is not the same thing at all. And I didn't even say they were good imitations. And the original question, by using the term "subset" also does not imply this.
    – Greg Lee
    Commented Feb 26, 2020 at 17:34
  • @csabinho I don't understand. What is a "criterion" for a natural language?
    – Greg Lee
    Commented Feb 26, 2020 at 17:37
  • In my reply ro @lemontree, please substitute "superset" for "sibset".
    – Greg Lee
    Commented Feb 26, 2020 at 17:56

Is linguistics a superset of programming language theory?

There's a programming language theory? I mean don't get me wrong

  • There's a Wikipedia page
  • A number of books on it
  • And even a course or two you'll be taking if you're Majoring in CS,

yet I don't think all programmers would necessarily accept it as a full-fledged discipline.

Rather I think we as programmers would consider constructing and analyzing programming languages to be a design problem, which relies on many fields within the greater domains of computation, logic and even linguistics.

What delineates the difference between the study of language and the study of programming languages?

Linguists are interested in languages humans use to communicate with one another, whether it be the syntax, semantics, phonology, orthographic representations, psychological and sociological factors which it is dictated by, to name just a few aspects to consider.

As for programming languages, you don't see anyone called a computer-linguist, this is what I meant when I said that I don't think a single discipline for designing programming languages is widely recognized. You can however be a computer scientist, who can specialize in many fields, one such being designing or analyzing programming languages.

The goal of designing a programming language is to find a nice way to communicate operations and instructions for a computer to perform.* The goal of analysis is to compare the capabilities and design choices of different languages, not to be confused with implementation performance.**

Ok then, assuming you're a computer scientist (or even a hobbyist, you don't really need any qualification for this) working on designing a programming language. You may do this informally based on features in previous languages you're familiar with. Or you may choose to do this formally, usually if you're going to try and introduce a new paradigm, by consulting mathematical literature on

  • formal semantics
  • previous material by other computer scientists
  • or theories and grammar-types proposed by linguists.

Your next question is especially related to this:

Programming languages define syntax and semantics of code. Does this mean programming languages are a subset of languages?

Not all programming languages are required to do this actually, check out Deadfish which practically has no (or absolutely-free) syntax: https://esolangs.org/wiki/Deadfish or Plankalkül : https://en.wikipedia.org/wiki/Plankalkül

But as you probably have seen, unlike these two obscure languages, the more popular languages at least somewhat resemble human-to-human languages on a surface level. To put things into perspective, we need to talk about the crux which binds programming and modern linguistics: The Chomsky Hierarchy. https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Chomsky-hierarchy.svg/400px-Chomsky-hierarchy.svg.png [Image Source: https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Chomsky-hierarchy.svg/400px-Chomsky-hierarchy.svg.png]

Also known as the Chomsky–Schützenberger hierarchy, it establishes a set of rules which can be used to generate various types of grammars. In particular Context-Free-Grammars are of interest, for allowing recursive grammar rules. This would go on to inspire Backus-Naur form, which would be influential in the design of new languages for a few generations.

Since it's a bit off-topic I'll just link 2 stack exchange questions if you'd like to learn more.

Today's programming languages don't make as much as an effort to ensure "context-free grammar" rules, since grammatically correct statements might lead to logical issues. But the point still remains, human-to-human languages are good teachers when it comes to studying what features might make a good language. And so, the computer scientist will turn to linguistics for inspiration from time to time.

In conclusion, whether there is a programming language theory is debatable, what is certain though is that any theory involving the design of programming languages is very intertwined with linguistics.

*Although I should note that communicating with computers using human-to-human languages is also a topic of interest, though it's mostly restricted to the field of Human-Computer Interaction.

**For instance Python is sometimes called a "slow-language" but this is related to the standard CPython implementation. PyPy, an unofficial implementation is able to run much faster. This isn't due to "information density" or anything, but the interpreter or compiler which evaluates the language in the background.


I would like to add another angle to the already posted answers: programming languages are about processing data, whereas natural languages are about transferring/communicating the data.

In more expanded terms: programming languages are characterized by limited syntax and vocabulary which however permit creating very complex data processing systems. (See, e.g., this article for some minimalist programming languages with very few words and syntax rules.)

On the other hand, natural languages possess very extended vocabularies, whereas their syntax is aimed at organizing information rather than processing it. In this respect Linguistics is more properly compared to the information theory and message encoding, where the syntax serves to communicate the largest amount of information using the smallest number of symbols. (Although to my humble knowledge, the information theory is largely limited to Markov chains, i.e. Regular grammars - a subset of CFGs).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.