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:
- A formal language is a set of finite words (lines, chains) over a finite alphabet.
- The sign system is a system of uniformly interpreted and interpreted messages / signals that can be exchanged in the process of communication. Sometimes, sign systems help to structure the process of communication in order to give it a certain adequacy in terms of the reactions of its participants to certain "signs". As an example of a sign system, language is usually given (both in written form and, in the case of natural languages, in the form of speech).
- A computer program is a sequence of instructions designed to be executed by a computer control unit.
- Lexika is a collection of words of a language, part of a language, or words that a particular person or group of people knows.
- Syntax is a side of a programming language that describes the structure of programs as character sets (usually they say, without reference to the content). The syntax of the language is opposed to its semantics. The syntax of the language describes the "pure" language, at the same time, the semantics assigns values (actions) to different syntactic constructions.
- Semantics in programming is a discipline that studies the formalization of the meanings of the constructions of programming languages by building their formal mathematical models. Various tools can be used as tools for building such models, for example, mathematical logic, λ-calculus, set theory, category theory, model theory, universal algebra. The formalization of the semantics of a programming language can be used both to describe the language, to determine the properties of the language, and for the purposes of formal verification of programs in this programming language.
- The language is a sign system that correlates conceptual content and typical sound (writing).
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 :
- Aspect-oriented programming (AOP) is a programming paradigm based on the idea of dividing the functionality to improve the breakdown of a program into modules.
- Structural programming is a software development methodology based on the representation of a program in the form of a hierarchical block structure. Proposed in the 70s of the 20th century by E. Dijkstra, developed and supplemented by N. Wirth.
- Procedural programming is programming in an imperative language, in which successively executed statements can be assembled into subroutines, that is, larger integral units of code, using the mechanisms of the language itself [1].
- Logical programming is a programming paradigm based on automatic proof of theorems, as well as a section of discrete mathematics that studies the principles of logical information output based on specified facts and inference rules. Logical programming is based on the theory and apparatus of mathematical logic using the mathematical principles of resolutions.
- Objective-oriented programming (OOP) is a programming paradigm in which the basic concepts are the concepts of objects and classes. In the case of languages with prototyping, instead of classes, prototype objects are used.
- Functional programming is a section of discrete mathematics and a programming paradigm in which the calculation process is interpreted as calculating the values of functions in the mathematical understanding of the latter (as opposed to functions as subroutines in procedural programming).
- A multi-paradigm programming language is usually a programming language that was designed specifically as a multi-paradigm programming tool, that is, the visual capabilities of which were originally intended to inherit from several, often unrelated, languages.
- Esoteric programming language - a programming language designed to explore the limits of programming language development possibilities, to prove a potential realization of an idea (the so-called “concept proof”, English proof of concept), as a piece of software art [en], or as jokes (computer humor).
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:
Is HTML a language?Yes. It has properties inherent in languages.
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.
Is HTML Turing a complete language?Not. Simply put, HTML can only perform a limited set of actions interpreted by the browser.
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.
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.