answersLogoWhite

0


Best Answer

Compilers translate the entire source code into machine code. Each translation unit (source file) is independently converted into an object file. Once all translation units have been compiled, the object files are linked together to produce an executable file. The executable file does not require any further translation and can be executed independently of the compiler. The executable is non-portable, but will execute as fast as the architecture will allow. In order to port the program to other architectures, the source code must be recompiled from scratch by a compiler intended specifically for those machines.

Interpreters translate one statement at a time and immediately execute them before moving onto the next statement. No independent executable is produced by an interpreter; the source code must be re-interpreted every time it is run. Thus the code is dependant upon the interpreter but is not machine-specific. While interpreted languages are more portable than compiled languages, execution is greatly impaired by the need to interpret the code every time it is run.

Some languages are both compiled and interpreted. Rather than producing a machine code executable, the compiler produces an intermediate byte code which can then be interpreted. Java is a typical example. The Java source code is compiled against the Java Virtual Machine (JVM) to produce portable Java byte code that can then be interpreted by any JVM implementation. Although execution is still much slower than that of machine code, the byte code is much more compact than the original source code and gives greater opportunities for optimisations that would not be possible with more traditional interpretation.

Because interpreted languages are dependant upon an interpreter, they are only suitable for writing applications software. This includes Java. Compiled languages are much less restricted. C++, for instance, can be used to write general purpose programs, including operating system kernels, device drivers, subsystems programming as well as applications software.

User Avatar

Wiki User

βˆ™ 8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

βˆ™ 11y ago

The principle difference is that an interpreter takes a computer program written in a high-level language and converts it to machine code "on the fly"; converting and then executing it as it goes through the program.

A compiler takes a computer program and converts the entire program into machine code file, this file can then be executed at a later date.

Modern computer systems often combine the two techniques; a compiler will take a computer program and convert it into a "pseudo" machine code file. This file is then taken by an interpreter and converted to actual machine instructions to execute. The advantage of this is that the compiler doesn't have to "know" about the final target machine, providing that the target machine has an interpreter it can execute the program. Java (and hence Android) uses this system as does much of Windows (using the .NET system).

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the difference between interpreter and compilers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between a translator and an interpreter?

A translator is written translation. And an interpreter is an oral translation.


What is the difference between computer interpreter assembler?

wee2


What is the difference between compilers and interpreters in c plus plus in tabular form?

C-compiler translates the C-source into Assembly or machine code. On the other hand, C-interpreter -- well, there is no such thing as C-interpreter.


State two differences between a compiler and an interpreter?

# An interpreter translates from source code to machine code on-the-fly; a compiler does it all before the program is executed. # Compilers can spend a lot of time on analysis and optimization, allowing for (generally) better performance of code.


What is compilers and interpreters the purpose?

compiler and interpreter used to convert high level language to machine level language .....compiler does dis job in atonce while interpreter does in step by step


What is the difference between interpreter and parser and compiler?

in my personal point of view i would say a parser is more like "one-directional" "automatic" vs. an interpreter, the interpreter has more "intelligence"


What is the difference between pure and impure interpreter?

fftaysuihi7y78yndh


You want to become a Russian - English translator where can you get an information?

To find answers to the following questions, visit http://www.soniamelnikova.com: What is a certified translator or interpreter? What is certified translation? What is the difference between translation and interpreting? What is a court interpreter? What is the difference between a registered and a certified court interpreter? Is special training recommended to become a court interpreter? What is ATA Certification? Also, visit: www.lingotip.com www.proz.com www.atanet.org


What is the difference between debugger and interpreter?

the answer is that no body knows what it is including me so crack it man.:P


What is the difference between a strict interpreter and a loose interpreter?

A strict interpreter must change every word from the speakers language to the listeners language. A loose interpreter has more liberty to relay the message in the most efficient way without concern of every word.


What is a hybrid compiler?

Hybrid compiler is a compiler which translates a human readable source code to an intermediate byte code for later interpretation. So these languages do have both features of a compiler and an interpreter. These types of compilers are commonly known as Just In-time Compilers (JIT). Java is one good example for these types of compilers.


What is the difference between simultaneous and consecutive interpreting?

Simultaneous interpreting is done in real-time while the speaker is talking, typically through headphones and a microphone in a separate booth. Consecutive interpreting involves the interpreter speaking after the speaker pauses, usually taking notes during the speech to aid in accurate translation.