There
are two kinds of such translation programs: compilers
and interpreters. The end result is the same (a
program of instructions that the computer can actually
execute), but an interpreter does the translation using
blocks of code and executes them as they are typed in
by the programmer, and a compiler produces a permanent
translation (called an object program) which
can be saved and executed over and over again at any
later time. Interpreters are good for testing and for
programs that will only be used once or twice, and on
the Internet for programs that are sent to your computer
over the network for execution (if you use the Internet
you will have noticed, perhaps, that javascript can
be included in websites and when you view such a website, the javascript is sent to your machine and interpreted
there). Compilers are more efficient, and are best used
for producing code that will be executed over and over
again on the same or very similar machines (such as
a bank’s computer running a program to produce customer
statements every month).
|