English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

what is the diffrents between compilers and interprenter?

2007-03-11 22:53:57 · 3 answers · asked by Jeyan 1 in Computers & Internet Programming & Design

3 answers

Compilers and interpreters are translators and their differences are...

Compiler translates the entire codes then produce an output.

Interpreters translates each single line of code before it produce a specific result or output.

A student can understand more if interpreter is the translator used because a student can see the step-by-step process of program.

2007-03-11 23:25:42 · answer #1 · answered by red scar 2 · 0 0

A compiler is simply a translator that takes language in one form and translates to another form. The translator could be for a computer language, a human language or some other language. There is a common misconception that a compiler must produce machine language output. If this were true then the Java compiler would be disqualified to be called a compiler because it doesn't produce machine code.

An interpreter on the other hand is a program that executes another program. Here is an example of a very simple BASIC interpreter, with source code in BASIC. http://www.runbasic.com/?_page=tinybasic.bas

In order for compilers and interpreters to do their thing, both of these kinds of software must "understand" the language they do their work on. So a compiler and an interpreter for the same language (say Java) could be written in such a way that they share a lot of the same code. The compiler would translate the Java code into another form, but the interpreter would execute the Java code.

Another twist on the idea of an interpreter is that many microprocessors actually use built-in software called microcode. When such a microprocessor is executing machine code it is actually running an interpreter. For more information on this see:

http://en.wikipedia.org/wiki/Microcode

2007-03-12 02:31:27 · answer #2 · answered by carlgundel 2 · 0 0

Compiler - a computer program (or set of programs) that translates text written in a computer language (the source language) into another computer language (the target language). The original sequence is usually called the source code and the output called object code. Commonly the output has a form suitable for processing by other programs (e.g., a linker), but it may be a human-readable text file.

In computer science the term interpreter is sometimes used instead of the term emulator. It can also refer to a program that performs compilation as well as emulation. Interpreters that compile source code usually do so when the code is first encountered during program execution, rather than in a separate phase prior to execution.

An interpreter has a number of advantages over a compiler, including:

* because it can be tailored to a specific programming language making it simpler to implement and more compact (BASIC was supported on many early home computers for this reason).
* it allows program implementation to be independent of the characteristics of the host cpu (the Java interpreter is a good example of this).

2007-03-11 22:59:38 · answer #3 · answered by Mortis 4 · 0 0

fedest.com, questions and answers