📜 ⬆️ ⬇️

Is HTML a programming language?

Recently, more and more often, various Internet resources are arranging holivars on the topic: is HTML the programming language or not. As usual, there are quite a few arguments in favor of both points of view, so I decided to put an end to this unnecessary argument for myself.

Definition of a programming language


Programming language is a formal sign system for recording computer programs. A programming language defines a set of lexical, syntactic and semantic rules that define the appearance of a program and the actions that the performer (computer) will perform under its control.

That is what Wikipedia says, and most of the other resources either use this definition in full, or set it loosely without losing meaning. Consider in more detail the components of the definition of PL:

In simpler language this can be stated as follows:
')
A programming language is a set of predefined, uniform and comprehensible to the performer (read: interpreter / compiler / computer / programmer) instructions designed to be written sequentially for the purpose of their execution by some device that is part of a computer. Also, the programming language should have a number of features: there should be a limited number of instructions, and everyone should know them; instructions should line up in a certain way to obtain certain results, and everyone should be aware of this; there should be rules for writing instructions and everyone should know them; Each language construct must unambiguously relate what is written to what was required to be designated.

That is so cumbersome and ugly happened, but without complicated words. We will return to this definition later.

Types of programming languages



Frequently they also use the division into low-level and high-level languages. These types differ in the "thickness of the layer" between the processor and the programmer. In simple words - in low-level languages, each instruction is one or a small number of processor instructions, and in a high-level language, each instruction is a large set of processor instructions.

Let's take a closer look at the definitions of different types according to Wikipedia :

Mandatory and declarative approach



All programming languages ​​are divided into two groups: declarative and imperative .

A program in an imperative programming language from a mathematical point of view is a general solution of the problem, in other words, the answer to the question "how to do?". This is a sequence of commands that the performer must perform.

A program in a declarative programming language is a combination of a task formalized within a programming language and all the theorems necessary to solve it, in other words, the answer to the question “what to do?”. The specific sequence of actions performed is performed by the compiler, or more often the interpreter — a program that executes the program code in real time without converting it into machine code.

Turing fullness


In the theory of computability, a performer (a set of calculating elements) is called turing-complete if any computable function can be realized on it. In other words, for each computable function there is a computation element (for example, a Turing machine ) or a program for the executor, and all functions computed by a set of calculators are computable functions (possibly, with some coding of the input and output data).
The name comes from Alan Turing , who invented an abstract calculator — a Turing machine — and defined many functions that are computable through Turing machines.
In other words, a language is Turing complete , if any computable function that you need can be written in this language and solved by its performer.



Non-Turing languages ​​also exist, but since they are created mainly for academic purposes, they are little known and not widely used.

Let's answer some questions:


  1. Is HTML a language?
    Yes. It has properties inherent in languages.
  2. HTML - corresponds to the definition of a programming language?
    Yes. It has syntax, semantics, vocabulary, it is a language and falls into the category of declarative programming languages.
  3. Is HTML Turing a complete language?
    Not. Simply put, HTML can only perform a limited set of actions interpreted by the browser.
  4. Is it possible to call HTML a programming language?
    Depending on the context - yes, you can. But it should be remembered that with the same success can be called PL and CSS, and XML and SQL. In other words, these languages ​​can be formally called programming languages, but only with a certain degree of skepticism and with full understanding that these languages ​​do not meet all the requirements.
  5. Is HTML a programming language?
    Not. The task of a normal programming language is in data processing, and the task is HTML in displaying data. It is not a programming language and cannot be computed.


Conclusion: We can call HTML a programming language only in the context of a formal controversy. In fact, it is a hypertext markup language and nothing more. But the reader should understand that if there are no clearly defined standards, then no one forbids to make a language identical in syntax to HTML, but interpreted completely differently so that it is complete Turing.

Source: https://habr.com/ru/post/231897/


All Articles