2
The Way of the Program
they are shorter and easier to read, and they are more likely to be correct. Second,
high-level languages are
portable, meaning that they can run on different kinds of
computers with few or no modifications. Low-level programs can run on only one
kind of computer and have to be rewritten to run on another.
Due to these advantages, almost all programs are written in high-level languages.
Low-level languages are used only for a few specialized applications.
Two kinds of programs process high-level languages into low-level languages:
inter-
preters and
compilers. An interpreter reads a high-level program and executes it,
meaning that it does what the program says. It processes the program a little at a
time, alternately reading lines and performing computations.
OUTPUT
SOURCE
CODE
INTERPRETER
A compiler reads the program and translates it completely before the program starts
running. In this context, the high-level program is called the
source code, and the
translated program is called the
object code or the
executable. Once a program is
compiled, you can execute it repeatedly without further translation.
OUTPUT
CODE
OBJECT
EXECUTOR
CODE
SOURCE
COMPILER
Python is considered an interpreted language because Python programs are executed
by an interpreter. There are two ways to use the interpreter:
interactive mode and
Chia sẻ với bạn bè của bạn: