0% found this document useful (0 votes)
94 views

1.1.2.4 Programming - Absolute Basics - Compilation vs. Interpretation

There are two main ways to translate a high-level programming language into machine language: compilation and interpretation. Compilation translates the source code once into an executable file that can be distributed, while interpretation translates the source code each time it is run using an interpreter program. A programming language is designed to use either compilation or interpretation due to fundamental reasons in its design.

Uploaded by

eka russanty
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

1.1.2.4 Programming - Absolute Basics - Compilation vs. Interpretation

There are two main ways to translate a high-level programming language into machine language: compilation and interpretation. Compilation translates the source code once into an executable file that can be distributed, while interpretation translates the source code each time it is run using an interpreter program. A programming language is designed to use either compilation or interpretation due to fundamental reasons in its design.

Uploaded by

eka russanty
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

6/28/2019 1.1.2.4 Programming - absolute basics | Compilation vs.

interpretation

    Sandbox (/sandbox)

Compilation vs. interpretation


Computer programming is the act of composing the selected programming language's
elements in the order that will cause the desired e ect. The e ect could be di erent in every
speci c case - it's up to the programmer's imagination, knowledge and experience.

Of course, such a composition has to be correct in many senses:

alphabetically - a program needs to be written in a recognizable script, such as Roman,


Cyrillic, etc.
lexically - each programming language has its dictionary and you need to master it;
thankfully, it's much simpler and smaller than the dictionary of any natural language;
syntactically - each language has its rules and they must be obeyed;
semantically - the program has to make sense.

Unfortunately, a programmer can also make mistakes with each of the above four senses.
Each of them can cause the program to become completely useless.

Let's assume that you've successfully written a program. How do we persuade the computer
to execute it? You have to render your program into machine language. Luckily, the
translation can be done by a computer itself, making the whole process fast and e cient.

There are two di erent ways of transforming a program from a high-level programming
language into machine language:

COMPILATION - the source program is translated once (however, this act must be repeated
each time you modify the source code) by getting a le (e.g., an .exe le if the code is intended
to be run under MS Windows) containing the machine code; now you can distribute the le
worldwide; the program that performs this translation is called a compiler or translator;

INTERPRETATION - you (or any user of the code) can translate the source program each
time it has to be run; the program performing this kind of transformation is called an
interpreter, as it interprets the code every time it is intended to be executed; it also means
that you cannot just distribute the source code as-is, because the end-user also needs the
interpreter to execute it.

Due to some very fundamental reasons, a particular high-level programming language is


designed to fall into one of these two categories.

Prev (/learn/programming-essentials-in-python/programming-absolute-basics-2)
https://edube.org/learn/programming-essentials-in-python/programming-absolute-basics-compilation-vs-interpretation 1/1

You might also like