DEV Community

Cover image for What is a Programming Language?

What is a Programming Language?

Jeremy Grifski on July 08, 2019

When most of us think about programming languages, we think about popular languages like Python, C#, and JavaScript, but where do we draw the line?...
Collapse
 
cout970 profile image
cout970

This article really makes you think. In my opinion, what we are trying to do it's separate languages into 2 categories:

  • What people call programming languages: a set of instructions that a computer can run.
  • What we call markup languages or storage formats: a way to represent data that can be interpreted by a program.

It's hard to classify languages, but I think that there are a few requisites for a language to be considered a programming language:

  • It must be Turing complete.
  • It should allow to transform data, a.k.a do computations.
  • Allow abstraction (functions. methods, lambdas, subroutines, subqueries, etc.)

With this criteria we can say that HTML is not a programming language. HTML is not Turing complete, it doesn't have the ability to make decisions. HTML cannot do computations, it just stores constants. And finally lacks a mechanism to do abstractions.

I may be wrong but this is my way to differentiate programming languages from other kinds of languages. I would love to hear some counterexamples if someone wants to prove me wrong.

Nice article btw.

Collapse
 
renegadecoder94 profile image
Jeremy Grifski

Honestly, I don’t know that I agree, but I like that you lay out some criteria in the same way that I did.

Currently, I don’t feel like there is a set of checkboxes that can be used to decide what is and isn’t a programming language. As a result, I choose to leave things more nebulous. In other words, if a machine can derive meaning from some data, that data is a programming language.

That said, I think you raise a good question. What does it mean to program? If flow control (or Turing completeness) is the criteria you use, then you can start to draw some lines.

Ultimately, I guess my issue with these arbitrary distinctions is that they can be used to marginalize people (not just languages). In other words, suddenly engineers aren’t real programmers because they use a language that isn’t general purpose.

Collapse
 
anpos231 profile image
anpos231

CSS and HTML are not programming languages. They have some basic grammar, but they are unable give computer instructions, just because we write HTML to produce output does not mean that the HTML is the language producing this output, it's simply a structured data that browsers use to create output.

There are esoteric interpreters that can interpret images and create output. Does that mean the image is a programming language? Nope, it was never meant to be a "programming language", it's still an image and just because the interpreter exists does not make an image a language.

I know this is a hard topic that people will probably continue to fight over for many years. I personally try to reason about it like this:

If (a thing) was created to become a programming language, it is a programming language. If (a thing) wasn't created to become a programming language, then it is not a programming language.

Collapse
 
iamschulz profile image
Daniel Schulz

I'm going to disagree with you there.
I don't think I can clearly defined what is and isn't a programming language, but I can program in css, in a manner of manipulating data. I can hand the computer instructions on how a thing as to behave in consideration of a number of variables, to the extent of managing the whole state of a a component. That clearly makes it a programming language, and by proxy html as well.

You're right in that css wasn't originally meant as a programming language, but your argument is pointless. Why shouldn't a language be able to evolve?

Collapse
 
renegadecoder94 profile image
Jeremy Grifski • Edited

I’m completely on board here. I think it’s really hard (and often dangerous) to start declaring some languages in and others out without some formal definition which doesn’t appear to exist. Otherwise, everyone gets to create their own definition. Then, as a consequence, elitist factions get to form around certain types of languages (i.e. only functional programming is real programming).

One example that always comes to mind is MATLAB (as mentioned in the article). One of my best friends uses it as a Mechanical Engineer, and he received a lot of elitist backlash when he was first learning to use it. To him, MATLAB is the right tool for the task, but a lot of folks in our community look down on it.

Ironically, I imagine someone in our community developed that language.

Collapse
 
renegadecoder94 profile image
Jeremy Grifski • Edited

I think you and I fundamentally disagree here. To me, the languages we typically think of as programming languages are just text (data) with some formal syntax. They derive their meaning from the interpreters or compilers that convert them into something useful for a machine. In other words, images on their own are not programming languages, but the esoteric interpreters provide the context to treat them as such.

I’m not sure why there has to be some arbitrary criteria to exclude or include different data formats from the programming language classification.

Collapse
 
elmuerte profile image
Michiel Hendriks • Edited

HTML is a markup language. Of course that does not say it is not a programming language, as TeX is both.

XML is a grammar, a more strict version of SGML. Based on XML you can create a programming language. For example: XSLT is an XML based programming language.

I think the best way to say if something is a programming language is if it is Turing complete.

HTML lacks the features to be Turing complete. CSS on its own also lacks the features.
But combined you can create a so called Rule 110 system, which is Turing complete. (Just search for "Rule 110 css" and you find plenty examples.)

So HTML+CSS is Turing complete, it can be considered as language with which you can write a program. And thus a programming language.

But I would never call it a programming language. Because that just dilutes the meaning of the word. And for what reason? Just because something is not a programming language does not make it worth any less.

SQL is Turing complete. But it is still a query language, and not a programming language. Minecraft redstone is Turing complete, but it is not a programming language. etc.

Languages or systems which are unintentional Turing complete can be considered esoteric programming languages. Their main value lies somewhere else, in a more specific domain.

Collapse
 
iamschulz profile image
Daniel Schulz

I'd say that query languages and markup languages are a subset of programming languages.

Your Minecraft example is interesting though, because it's easily translatable to graphical programming like puredata. You don't write your stuff per se, yet you're programming, with a specific set of rules, grammar, etc. If not programming language, how would you call that?

Collapse
 
elmuerte profile image
Michiel Hendriks

I think Minecraft redstone can be better qualified as a FPGA.

Collapse
 
renegadecoder94 profile image
Jeremy Grifski

I also have to challenge some of the arguments here. Why mention Turing completeness as a criteria if you ignore it in some cases? Why does designer intent matter more than practical use?

Collapse
 
elmuerte profile image
Michiel Hendriks

As I said, it dilutes definitions. Terms become meaningless if you make them to broad. If we would consider SQL a programming language, then we would also consider somebody who's main role is to write SQL a database programmer.

One of the main issues with natural language is that it is really unclear about meaning of words, and sentences, and sometimes even paragraphs. If we keep making definitions ambiguous it will only get worse, and we could literally(*) lose its purpose.

*) this is just an example where this word has been misused so often, that literally has as alternative meaning "figuratively".

ps, I would not say that SQL, HTML+CSS, Minecraft Redstone have a practical programming use; it's rather impractical to use it as programming language.

Thread Thread
 
renegadecoder94 profile image
Jeremy Grifski • Edited

I guess my point was that you don’t really further solidify a definition. You provide some arbitrary criteria (Turing Completeness) that you simultaneously violate (some Turing Complete languages aren’t programming languages).

In other words, it seems like your criteria is more of a feeling or bias rather than something that can be verified.

At any rate, I do appreciate the discussion! I think you raise a good point about diluting terminology. I’m just not sure it’s an issue in this case.

Collapse
 
jasman7799 profile image
Jarod Smith

I think if we continue down this path, then eventually you would converge on any language is a programming language because a language is inherently designed to be read, wrote, and to be interpreted. This I think is close to the truth, but the problem is that it doesn't correctly focus on the right part of the argument. All languages can be programming languages, but not all of them always are.

What makes a language a programming language is its intent. The intent of the language must be to translate from one entity to another entity a set of instructions to follow. In this way a set of colored blocks could be made into a programming language.

Beyond this there are languages which have been made with the exclusive intent to convey instructions from one entity to another i.e. a human to a machine, and these specific languages have been given the title of programming languages to express the intent of the language.

Collapse
 
renegadecoder94 profile image
Jeremy Grifski • Edited

This is really spot on!

I think the big issue with the term "programming language" is that nobody really has a concrete idea of what that means. As a result, pretty much anyone can draw a line in the sand and declare something is or is not a programming language. As consequence, an elitist can come along and use those lines to arbitrarily exclude people.

So, maybe the line is just "human to machine." That way, we can exclude other mediums like music, but keep the category broad enough as to not exclude people who use MATLAB, HTML, XML, CSV, etc.

Collapse
 
jainish06915235 profile image
Jainish Patel

Programming Language is helpful to create an innovative machine. whenever the code is used. it is a programming language.