What is a programming language
What is a programming language
A programming language is a formal sign system in which computer programs are written. It can be thought of as a set of various rules and commands on the basis of which a programmer writes code.
Natural language is a means of communication between a person and another person. A programming language is a means of communication between a developer and a computer. The programmer writes code that tells the device what it needs to do, what process to perform. The sequence of actions itself is called an algorithm, and the programming language helps to write it down.
Programming languages have a set set of commands and a specific syntax: how commands should be written. For example, many languages end a line with a semicolon to help the computer separate one command from another.
There are thousands of programming languages in the world, dozens of them are in demand on the market. There are many of them, because different technologies and principles are needed to solve different types of problems.
Who uses programming languages
Programming languages are used by developers, system administrators, network engineers, DevOps, ethical hackers, testers, and many others. Of course, each goal will require its own language. It can be any industrial programming language or the internal language of a certain system – it all depends on the area in which the specialist works. One PL can have several areas of application.
What are programming languages for?
At the deepest, lowest level, everything a computer does is reduced to electrical signals. They are converted to machine codes: numbers in the binary system. One is the presence of the signal, zero is the absence. But it is almost impossible for a person to work with such concepts. Imagine: instead of one command, you need to write several hundred zeros and ones. It’s unrealistic.
Therefore, programming languages appeared. They look more human-readable than machine codes and are easier to write on. With the help of programming languages, a developer can keep in mind and implement even very complex designs. Languages come in different levels: closer to machine codes or far from them, but close to human concepts. Different types of tasks require different levels. The requirements for the language, basic principles and features also depend on the task.
How a computer recognizes programming languages
If digital devices operate on the basis of machine codes, how do they recognize programming languages? To do this, there are special converters – compilers and interpreters. These are special programs that “turn” the written code into a set of commands understandable to the computer. They can be compared to translators. They differ in the principle of operation.
The compiler receives code as input and compiles it – it collects, converts it into an executable file all at once. Then this executable file can be run, and the computer will understand what they want from it.
The interpreter “translates” the code line by line and immediately initiates its execution. First, it will read and send the first line for execution, then the second, and so on.
Depending on which “translator” is used in a particular programming language, they are divided into compiled and interpreted. Due to the peculiarities of the transformation, these two varieties have their own nuances of behavior. This is important, for example, when debugging.
Where do programming languages, compilers and interpreters come from?
They are written when the language is created by its developers. To do this, they use other programming languages, usually lower-level ones, that is, closer to the hardware. Here is an example: the high-level Python language is written in C / C ++, and they, in turn, are in assembler – a very low-level language, below which only the machine codes themselves.
The same goes for compilers and interpreters. They are the most important part: they determine how the computer perceives commands. Together with some other technical programs, such as garbage collectors, they form the implementation of the language, or its engine. Sometimes the implementation is called the compiler or interpreter itself.
It happens that for one PL there are several compilers or interpreters: each of them is written by a separate development team. Some by creators, others by a third-party community or company.