Advantages and Disadvantages of Using Interpreters
Programmers usually write programs in high level code, which the CPU cannot execute; so this source code has to be converted into machine code. This conversion is done by a compiler or an interpreter. A compiler makes the conversion just once, while an interpreter typically converts it every time a program is executed (or in some languages like early versions of BASIC, every time a single instruction is executed).
An Interpreter is a program which translates the source code into a machine understandable language, and executes it statement by statement. Translation happens on the fly which is followed by immediate execution. This process is more complex which makes interpreted programming languages to run slower compared to languages that are compiled. Compiler in contrast, translates high level language into machine code only once, which later can be executed multiple times (there is no immediate execution needed as it happens in the case of Interpreter). compiled high level language can run on computer that has appropriate compiler for that specific high level language. A benefit of Interpreter over compiler is that interpreter is more portable. It can run on different hardware processors and software while compiler program is written for each software and hardware processor separately. In order to increase portability some programs are first compiled into standard machine language and then interpreted using interpreter. One of the great example is the Java programming language which is compiled into standard machine language Bytecode, and then executed by Java Virtual Machine (JVM), software interpreter. Java programming language can run on any machine that has JVM interpreter; therefore, in order to increase portability of Java first it is compiled into Bytecode and then interpreted by JVM interpreter.
Read more about this topic: Interpreter (computing)
Famous quotes containing the words advantages and/or interpreters:
“We work harder than ever, and I cannot see the advantages in cooperative living.”
—Lydia Arnold, U.S. commune supervisor (of the North American Phalanx, Red Bank, New Jersey, 1843- 1855)
“Hence anyone who seeks for the true cause of miracles, and strives to understand natural phenomena as an intelligent being, and not to gaze at them as a fool, is set down and denounced as a impious heretic by those, whom the masses adore as the interpreters of nature and the gods.”
—Baruch (Benedict)