Is HTML a Programming Language?
web.media.mit.edu
web.media.mit.edu
Don't get me wrong, I'm fine with lowering the bar and calling them "Turing Complete" as a practical matter. I'm against then turning around and raising the bar and pretending Turing Completeness is implantable when it comes to defining "programming languages."
"Programming language" is an engineering term not a mathematical one.
"Brainfuck etc" - by which we mean not just joke programming languages but most (all?) programming languages generally considered to be Turing complete - don't prohibit infinite storage, and tell you how they would behave if somehow they were run in an environment where they did have infinite storage available.
In that sense, I think it is extremely reasonable to say "the language is Turing complete", without any lowering of the bar.
Any individual finite realization of that language will, of course, be theoretically a finite state machine. But you can't reason about how that restriction of the language will behave (for instance, whether it will halt for all inputs) in the general case without naming the particular resources available. And at that point, it's still not a convenient form for those kinds of questions.
2. Let us assume that Turing Completeness is an essential property [in the medieval sense of "essential property"] of programming languages. Using a Turing Complete programming language called "TC" I write a Domain Specific Language called "DFA" for constructing Deterministic Finite Automata. Because Deterministic Finite Automata are "sub-Turing Complete", DFA is not Turing Complete and hence statements in DFA are not written in a programming language. But being isomorphic with statements in the "TC" they must be written in a programming language. Reductio ad Absurdum.
3. It is Turing Complete languages that are hard to reason about. That's why we have the Halting Problem. Deterministic Finite Automata always finish. What makes programming in HTML useful is that whole categories of problems are precluded.
In that case, regarding 2, any encoding from a Turing Complete language into machine code must inevitably be an approximation. That says nothing about the source language.
Regarding 3, I mostly agree - if you can comfortably accomplish your task in a language that is not Turing complete, then making the language Turing complete is a bug not a feature. That is true whether the task is programming or markup.
I would say that HTML is not a programming language because it is not very good for programming; it is a markup language, because it was designed for markup and is much better for markup than for programming or most other tasks. Turing completeness is irrelevant.
Says who?
Turing completeness is nice and all, but it also comes with some baggage and difficulties. There's value in having constrained domain specific languages.
Says most of the people who care, and who therefore use the term the most.
Says most of the people who care, and who therefore use the term the most.
The first is to observe the Argument of the Beard.
Next is to think about how telling your VCR to start recording whatever's on TV at 3pm and stop at 4pm is known as programming it.
After that I get lost in a quagmire of musing whether SQL is a programming language.
After that I start thinking about Turing completeness, followed quickly by the observation that there are things that are Turing complete that I would not consider to be programming languages.
And then at some point I realize we're just idly shuffling words and the meanings of words around the table. That's where I suddenly lose interest because I've really got no reason to have a problem with the current vernacular meaning of the term.
Like what?
Not programming, not programming and, yes, not programming.
There's certainly use in confronting elitism and FUD, but having a technical kernel (see what I did there? :P) of truth supporting a more abstract argument would be far more compelling imho. I'd really love to see more discussions about <canvas> and what it means for the future of HTML as a language (and whether or not it will come to be a more fully-fledged programming language itself).
You are, of course, correct though, <canvas> is not actually Turing complete without JS; but then a Turing machine cannot operate without both the ticker tape and the pen to write on it. Given that, JS + <canvas> seems to be a near perfect analog to a Turing machine to me. (Though, I can think of numerous ways that someone might disagree.)
Either way, I would still like to see more in-depth analyses of this interaction; and I find it odd that a discussion of HTML as a programming language would make no mention of it whatsoever.
I'm not sure this is at all useful.
"Go get some more education at an institution other than a glorified vocational training center."
What makes
(print "Hello World") ; MIT/GNU Scheme
a proper program, and <p>Hello World</p>
something else seems more rooted in opinion than any intrinsic difference.That seems more a matter of current tooling, not anything about the languages themselves. Did Java only become a programming language when someone wrote a compiler to machine code? Is perl more in the same category as C or as HTML? Quite a few languages dynamically link a runtime, and most are dependent on OS facilities that could be extended to handle HTML.
To be clear, I emphatically agree that html is not a programming language, I just don't think this is getting at why.
Some markup languages let you do some programming, and vice-versa. There are also some candidates for being considered both a programming language and a markup language. HTML, absent js, doesn't seem to be one of these.
To be honest, I am not sure precisely how I would define programming. A first attempt would be "structuring events and computation, often by reference to future input".
As with most definitions outside mathematics, it's going to be fuzzy.
Edited to add:
Note that with this framework, whether you are programming is not determined by what language you are using.
BTW,it is practical to compile the HTML into machine code. MIT/GNU Scheme could be used to do the trick.
I have not really come down on one side or the other (mainly because I do not have the requisite experience and have not yet had the time to research the question thoroughly enough to form a well-founded opinion). But, that programming languages must be Turing complete is not necessarily a given.
Computer Scientists use Coq and Web Designers use HTML. Denying HTML is a programming language is a mechanism for denying a particular form of legitimacy to a particular cluster of activities. It's not like you're average Java programmer could actually prove that Java is Turing Complete in polynomial time. Most people take it on authority that C is Turing Complete, and that's reasonable because that's the way science largely works.
My point is that excluding HTML from the family of programming languages is a social distinction. And mentioning Turing Completeness is usually a way of cutting off conversation not opening it up.
(print "Hello World")
Where is the Turing Completeness? Or more specifically how does the it express Turing Completeness any more or less than: <p>Hello World</p>
It is only by resorting to metaphysics that one can claim that one is a program and the other isn't despite both producing the output Hello World. <a href="http://www.piday.org/million/">π</a>
Takes advantage of memoization and lazy evaluation.Therefore, HTML is a programming language, IMHO. It may be "primitive" in the pecking order of programming languages based on some arbitrary definition of sophistication, but it rises above the stated definition.
At that point you've robbed the term of any useful meaning.
1. You could try a formal definition -- such as Turing completeness
2. You could accept a colloquial definition. This definition has to be extracted from the things that people call programming languages.
If you opt for #1, then you have to accept you have abandoned #2. There are things that are Turing complete which people in the ordinary use of English may not think of as programming languages. (For instance: an actual Turing Machine with the infinite tape).
If we go with #1, knowing full well that it may be counter-intuitive, then we are left with a technical question which, at least, can be answered. You can see if rule 110 or whatever can properly be implemented. You can decide if some feature of the browser allows for it and so forth. At least you know what the exercise is.
If you decide you want to capture people's intuitive sense of a "programming language" then you have to intuition monger. I think intuitions are informed by the use of the word "language" as well.
So, for instance, people may "program" a VCR, but no one calls that using a programming "language." This is because it does not feel language-like to us. Same with an actual Turing machine. If you transcribe the instructions of the Turing machine into instructions like "1 - go forward, 2 - print a 1, 3 - go back" etc, then suddenly it "feels" like a language.
If you accept that you are intuition mongering, I think you would have to poll people who are familiar with HTML and other languages and ask them. (I suspect they would say, in general, that it is not).
Of course, #2 may change as the language evolves and our sense of what a "language" is evolves with it.
FWIW, the post is from September 2003:
HTML is more like Powerpoint, XML like MS-Access.
<style type="text/css">
body {
background-color: white;
}
.bodytext {
color: black;
}
</style>