is HTML a programming language?
for as long as HTML has existed, nerds have fought over the question of if it is a "programming language" or not. of course, to answer this question, we first must define what a programming language is.
…but doing that sounds really hard, so i'm not going to do that right now. instead, why don't we just say that anything that can simulate a Turing machine is a programming language? and with that set aside…
IS HTML TURING COMPLETE?
no.
HTML is not able to simulate a Turing machine because it is a document, not a machine. it's doing as much computation as a book.
but wait, who uses just one piece of HTML at a time? isn't the whole point of HyperText that you can use those fancy "anchors" to Hyper between your Texts? shouldn't we include that too?
okay, fine. i'll allow multiple pages, and a user to click between them as well.
IS HTML (with multiple pages and someone to click between them) TURING COMPLETE?
yes. simply instruct the user to simulate the Turing machine in their head.
…no, that's cheating. if the user does all the thinking, then we can say anything is a Turing machine! a pen and paper is a Turing machine, by that logic.
yeah, i should have expected that. i'll add another rule then.
IS HTML (with multiple pages and someone to click between them (who isn't allowed to make any decisions)) TURING COMPLETE?
…maybe?
with only HTML, and without allowing the user to choose anything, it is actually possible to construct a deterministic finite automaton, as shown here by Bruno Dantas. and — if my understanding of theoretical computer science is correct here — if we assume that the Turing machine in question that we're simulating has a finite size, we can simulate it with an also-finite (but much larger) DFA.
wait, what about CSS? who even uses HTML these days without adding a bit of style?
good point.
IS HTML + CSS TURING COMPLETE?
no, because that's still just a static document.
oh COME ON
IS HTML + CSS (with someone to click the buttons) TURING COMPLETE?
yes!
since CSS gives us checkboxes, and the ability to show and hide things based off the state of them, we now have a conditional jump. using this, we can implement Rule 110, as shown here by Eli Fox-Epstein.
well that feels anticlimactic. it's just a bunch of checkboxes. so what?
such is the nature of Turing's tarpit.
that was fun! but does any of that really matter? why were we asking this in the first place? maybe we should actually think about what people mean when they say "programming language" to begin with.
well, we know it's some kind of thing that a computer uses to turn text into doing stuff. the actual way it does that is through parsing a formal language. if we assume that "formal language" and "programming language" mean basically the same thing, then HTML would absolutely be a programming language.
of course, that's not true; a programming language is just a special case of a formal language. since HTML encodes static documents instead of executable programs, it exists as a shining example of what a markup language is. still, there clearly is a useful distinction to be made when talking about any formal language designed to be parsed primarily by computers… which is why the term computer language was coined. maybe we ought to use that one more, eh?
i think that when some people say that HTML is not a programming language, they are not doing so because they truly care about the theory of formal languages. instead, they're probably just saying it because they view HTML as being less important than a "real" programming language. usually, this is because they look down upon work like typesetting and design for just making stuff pretty, and not doing any real work. i've wrote in the past about why i think this is such a flawed mindset to have about programming, not to mention a total dick move.
still, in most cases all of this is little more than useless pedantry. the average person will continue to use the term "programming language" when they really mean "computer language" in the same way people still say a snake is "poisonous" when they actually mean it's "venomous". it's fine if someone lists HTML as a "programming language" on their resume or whatever; you don't need to spend all your time correcting people about things they really don't care about.
and don't let anyone make you think that you need to use Javascript to implement anything interactive on the Web. an adventure with branching paths and infinite loops could easily be implemented as nothing more than plain HTML with links, like a "choose your own adventure" book. hell, if you abuse CSS enough, you can even make entire games using it!
…even if you probably shouldn't go that far with it.