Compiling Programs

People communicate instructions to the computer in symbolic languages and the easier this communication can be made the wider the application of computers will be. Scientists are already working on Artificial Intelligence and the next generation of computers may be able to understand human languages. The translation of a high-level language into machine language is performed using one of two methods: compilation or interpretation. During compilation, a computer program called a compiler translates a program written in a high-level language entirely into machine language. The machine language version of the program can then run on the computer without the compiler.

In interpretation, a computer program called an interpreter translates the high-level program into machine language in a line-by-line manner, each line of the high-level program being translated into machine language and then run by the computer.

A compiler is a software program. A compiler analyzes a program developed in a particular computer language and then translates it into a form which is suitable for execution on a particular computer system.

The program that is to be compiled is first typed into a file on the computer system. Computer installations have various conventions that are used for naming files, but in general, the choice of the name is up to you.

The program that is entered into the file is known as the source program. Once the source program has been entered into a file, we can then proceed to have it compiled.

The compilation process is initiated by typing in a special command on the system. When this command is entered, the name of the file that contains the source program must also be specified.

In the first step of the compilation process, the compiler examines each program statement in the source program and checks it to ensure that it conforms to the syntax and semantics of the language. If any mistakes are discovered by the compiler during this phase, then they will be reported to the user and the compilation process will end right there. The errors will then have to be corrected in the source program, and the compilation process restarted. Typical errors reported during this phase of compilation might be due to an expression that has unbalanced parentheses (syntactic error) or due to the use of a variable which is not “defined” (semantic error).

When all of the syntactic and semantic errors have been removed from the program, the compiler will then proceed to take each statement of the program and translate it into a “lower” form. On most machines, this means that each statement will be translated by the compiler into the equivalent statement or statements in assembly language needed to perform the identical task.

After the program has been translated into an equivalent assembly language program, the next step in the compilation process is to translate the assembly language statements into actual machine instructions. This step may or may not involve the execution of a separate program known as an assembler.

The assembler takes each assembly language statement and converts it into a binary format known as object code, which is then written into another file on the system.

After the program has been translated into object code, it is then ready to be linked. The purpose of the linking phase is to get the program into a final form for execution on the computer.

The words to the text:

artificial искусственный

entirely полностью, всецело

particular особый, особенный

suitable подходящий

execution выполнение, исполнение

to type печатать

convention условность

to contain содержать

source program исходная программа

to ensure гарантировать, заверять

to conform соответствовать

error ошибка

due to из-за

parentheses круглые скобки

variable переменная

to proceed продолжать

to involve вовлекать, включать

purpose цель, намерение

Наши рекомендации