Table of contents:
- Compiler - what is it?
- Compiler and interpreter - similarities and differences
- Compiler classification
- Compiler device
- Programming languages and translation methods
- Advantages and disadvantages of compilers and interpreters. Applications
Video: What is a compiler, or How to make a computer understand what you want from it?
2024 Author: Henry Conors | [email protected]. Last modified: 2024-02-12 02:40
The final stage of creating a program is to translate an algorithm written in one of the programming languages (C/C++, Pascal, etc.) into a low-level machine language. This is due to the fact that in order to perform any task, computers need to be given commands in a language they understand, close to binary and operating with primitive data structures (bit, byte or word). The process of translating domain-specific statements of high-level languages into binary code is called translation. There are two translation methods - compilation and interpretation.
Compiler - what is it?
Analysis of many interpretations of the terms "compiler" and "compilation" allows us to highlight the following definition. A compiler is a program designed to translate the text of a source algorithm from a high-level language into an equivalent set of instructions in a machine-oriented language. This is the so-called object code, for the subsequent assembly of the resulting object code into a ready-to-use program module.
Compiler and interpreter - similarities and differences
An interpreter is a utility thatas well as a compiler, designed to translate source code into machine code. However, unlike the compiler, the interpreter runs every time with the program and performs the translation line by line.
You can say that the compiler and interpreter are language processors that allow the computer to recognize and execute commands given by the programmer.
Compiler classification
Compilers are classified mainly by features related to their areas of practical application.
Vectorizing compiler is a utility that translates source code into object code and is adapted for computers equipped with vector processors.
A flexible compiler is programmed in a high-level language in a modular fashion. Its management is carried out using tables. It is also possible to execute it using the compiler of compilers.
Incremental compiler is a language processor that retranslates separate fragments of source code and additions to it. However, it avoids recompiling the entire application.
An interpretive (stepping) compiler is a utility that sequentially performs independent compilation of each statement or command of a high-level source code.
A compiler of compilers is a translator capable of accepting a formal description for a programming language and independently generating a compiler for any language.
The debug compiler allows you to find and fix some kinds of syntax errors made when writing source code
A resident compiler occupies a permanent place in RAM and is therefore reusable by a wide range of tasks.
The self-compiled compiler is written in the same language as the translation.
The universal compiler is based on a formal description of the semantic and syntactic parameters of the input language. The main components of such a utility are the core, syntactic and semantic loaders.
Compiler device
A compiler and a linker are at the heart of any compiler. Often, when compiling, an external linker is used, and the compiler itself performs only the translation function. It also happens that the compiler is implemented as a kind of manager program that is associated with the translator (or translators, if different programming languages were used when writing the source code) and the linker and starts their execution when necessary.
Programming languages and translation methods
Despite the fact that a program written in any programming language can be both compiled and interpreted, many high-level languages have a predisposition to one or another method of translation. So, the C language was originally designed for compilation, and Java - for the interpretation of the written program. Are being developedC compilers are quite easy, thanks to its relatively low level and a small number of structural elements.
Advantages and disadvantages of compilers and interpreters. Applications
Note that compiled applications are faster than interpreted ones, but at the same time, the machine code obtained as a result of compilation depends on the hardware platform. So, a program written and compiled for Windows will not work, for example, in Linux. Therefore, in the case of Internet applications, when it is impossible to say in advance in which environment they will work, they use interpretation or bytecode (in this case, the source program is converted into an intermediate form that can be executed on various hardware platforms).
Recommended:
How to understand if you are beautiful or not: test analysis, beauty standards, classic proportions and personality
Many girls are puzzled by the question: how to understand whether you are beautiful or not? What to do if such a dilemma arises, and how to be able to answer the question without embellishment? You need to objectively assess your appearance and find out the standards of beauty. You should also pay attention to your own intuition. What does she say when you look in the mirror? So you couldn't answer? Then read the article
Sow a thought - you reap an action, sow an action - you reap a habit, sow a habit - you reap a character, sow a character - you reap a destiny
It's popular these days to say that thoughts are things. However, physics as a science refutes this, because a thought cannot be touched and seen as an object. It has no form and no speed of movement. So how can this abstract substance influence our actions and life in general? Let's try to figure it out
An earring in the navel - and you want it, and it pricks! Proper piercing care
Glittering rhinestone jewelry in the navel, on the nose or on the tongue… Today it is considered the standard of beauty and aesthetics. But in the pursuit of style, we completely forget about our he alth. Any piercing, be it an earring in the navel or a ball on the tongue, is risky jokes with your body! If you think that we will now begin to dissuade you with all our might from the idea of piercing, then this is not so. We simply advise all girls who are obsessed with the desire to pierce their navel to read this article
How to understand that a man really loves you? How to understand if a married man loves you?
How to understand that a man really loves you, how to figure out how supportive he is and how the signs of the zodiac love - read about all this in this article
"If you want peace, prepare for war!" and other catchphrases
Many catch phrases of the great ancient historians, followers of philosophy and scientists are quite relevant at any time and especially now. What thoughts did our predecessors leave us as a legacy? And what are they telling us? This is what we will try to find out in this article