HPML is a programming language

You read again and again from people who supposedly know how to program HTML - how does that work? I can only speculate about the motives of these people, maybe they think they are programming because they are dealing with code and code? Sure, it must have something to do with programming! Others may simply not know a better word for what they are doing with HTML or they just want to be geek, because as a programmer you are a clever hacker. To claim that HTML is a programming language is of course nonsense.

An unscientific explanation

HTML pages are not programmed, and the people who write HTML are not programmers. Instead, HTML is a markup language (this is also what the last two letters of the English acronym stand for: HTML - Hypertext Markup Language) and HTML is not programmed, but simply written. Writing HTML pages is roughly on par with writing Word documents (there are even supposed to be people who actually write HTML pages with Word). HTML has no commands and essential language constructs from "real" programming languages ​​(loops, conditions, etc.) are missing. So you can't write algorithms in HTML.
Real programming languages ​​on the web, on the other hand, are Java, JavaScript, PHP and Perl. They can be combined with HTML, but therefore do not turn HTML into a programming language.

A scientific explanation

Phew, first I have to go back a little ...

Presumably, this explanation completely bypasses the target group, because whoever describes HTML as a programming language has probably never seen or even used a real programming language and they will lack some comparison options for this explanatory approach. Well, let's go ...

Alan Turing

Alan Turing was a British logician and mathematician and is a major founder of theoretical computer science. Turing developed one of the first chess programs and invented the Turing test. In addition, Turing was involved in the development of the tube computer Colossus involved, which helped the secret language of the German armed forces Enigma to crack and thus made a decisive contribution to the turn of the Second World War.
In particular - and this is important in connection with my explanation - Turing developed a (theoretical) device with which all mathematical functions can be calculated (basis for the first computer models). This device will Turing machine called.
Alan Turing was born in 1912 and died of cyanide suicide in 1954 after being accused of homosexuality and suffering from depression as a result of psychiatric treatment with estrogens.
Every year the Turing Prize is awarded in honor of Alan Turing - one of the most important computer science awards.

Turing machine

Everything that can be calculated can be calculated with the Turing machine. There is no mathematical function that can be solved as a human being, but which the Turing machine fails at. The simplest version of the Turing machine is the 1-band Turing machine. It consists of the following components:

  • A storage tape of infinite length (on both sides).
  • The tape is divided into an infinite number of storage cells.
  • Each memory cell can contain exactly one character (e.g. "a", "c") or a space.
  • A read and write head that is controlled by a control unit.
  • The head is controlled by a program.
  • The read / write head has an initial state z0.
  • At the end, the result is written to the tape by the read / write head.

(Turing machines are a theoretical model, because it quickly becomes clear that you cannot build a Turing machine with an infinitely long storage band. In addition, the Turing machine is too slow in practice.)

The program for the Turing machine has the following properties:

  • Read access
    The character can be read at the current position of the read / write head.
  • conditions
    A condition (~ if) can be queried, namely whether a certain character is contained in the current position.
  • Write access, movement of the read / write head and change of status
    It can perform an action, namely move the read / write head one memory cell to the left / right, write a character or space at the current position and change the state z.

Based on this very simple computer model and the 3 program instructions, additional functions can be implemented. First there are the arithmetic functions (addition, multiplication ...) and on the other hand you get the basic language constructs that (almost) all programming languages ​​have in common, namely loops, conditional statements, jumps, recursions, arrays etc. etc.

The special thing about the Turing machine is that all other computer models (automats) can be simulated with it. Even the functioning of very complicated and advanced computer machines (e.g. quantum computers) can be imitated with a Turing machine (which, however, can be very complex due to the primitive basic functionality of the Turing machine). The reverse is also true: the Turing machine can be emulated on any other computer model.

If a computer model or a language can calculate everything that can also be calculated with a Turing machine, then the computer model or language is called Turing-complete designated. However, if there is a mathematical function that cannot be calculated with the model or the language, then one speaks of Turing incompleteness. To put it a little differently, it means that you cannot use a Turing-incomplete language all can calculate mathematical functions.

Almost all of today's programming languages ​​are Turing-complete, regardless of whether they are imperative, object-oriented or functional programming languages. Even very specialized or restricted languages ​​such as XSLT and Basic can be turing-complete and thus programming languages ​​(you do not have to be able to program operating systems with a programming language).

Back to HTML

It is now very easy to prove why HTML is not a programming language. It is enough to show that HTML is turing-incomplete, that is, that there is a mathematical function that cannot be calculated with HTML. A simple function would be f (×) = x. This calculation of f (×) is impossible with HTML and thus HTML is not a programming language.

The entry was published on Saturday, March 25th, 2017 at 9:51 pm and is filed under Other. you can follow any comments on this entry through the RSS 2.0 feed. you can write a comment or set up a trackback on your site.