answersLogoWhite

0


Best Answer

The execution of a program can happen either natively -- the intructions are actual CPU instructions, or it can happen through an interpreter. The interprer thus takes instructions (which are typically not native CPU instructions), and performs the actions associated with the instruction (open a file, write a character to the screen, etc). The interpreter is thus in charge of the execution of the program instructions.

Now consider a program written in spoken English. It is obvious that the CPU does not understand spoken English. We can either use an interpreter to execute this program, or we can translate to "another form" (typically machine code specific to a particular CPU) -- using a compiler. This "other form" may require additional things to happen, so the compiler may insert extra instructions to cater for these things. The end result is our spoken English program, in another form -- either native, which can be executed by the CPU, or an a form which requires that an interpreter be used to execute it.

The interested reader is encouraged to read Allan Turing's groundbreaking paper on computing machines entitled "On computable numbers: With an application to the Entscheidungsproblem". You can find this easily by simply searching for this title with your favourite search engine.

Another AnswerWe usually prefer to write computer programs in languages we understand rather than in machine language, but the processor can only understand machine language. So we need a way of converting our instructions (source code) into machine language. This is done by an interpreter or a compiler.

An interpreter reads the source code one instruction or line at a time, converts this line into machine code and executes it. The machine code is then discarded and the next line is read. The advantage of this is it's simple and you can interrupt it while it is running, change the program and either continue or start again. The disadvantage is that every line has to be translated every time it is executed, even if it is executed many times as the program runs. Because of this interpreters tend to be slow. Examples of interpreters are Basic on older home computers, and script interpreters such as JavaScript, and languages such as Lisp and Forth.

A compiler reads the whole source code and translates it into a complete machine code program to perform the required tasks which is output as a new file. This completely separates the source code from the executable file. The biggest advantage of this is that the translation is done once only and as a separate process. The program that is run is already translated into machine code so is much faster in execution. The disadvantage is that you cannot change the program without going back to the original source code, editing that and recompiling (though for a professional software developer this is more of an advantage because it stops source code being copied). Current examples of compilers are Visual Basic, C, C++, C#, Fortran, Cobol, Ada, Pascal and so on.

You will sometimes see reference to a third type of translation program: an assembler. This is like a compiler, but works at a much lower level, where one source code line usually translates directly into one machine code instruction. Assemblers are normally used only by people who want to squeeze the last bit of performance out of a processor by working at machine code level.

Compiler

A Compiler is a program that translates code of a programming language in machine code

*****Translated source code into machine code***** .

A compiler is a special program that processes statements written in a particular programming language and converts them into machine language, a "binary program" or "code," that a computer processor uses.

A compiler works with what are sometimes called 3GL and higher-level languages (3rd-generation languages, such as Java and C

Interpreter

Interpreters translate code one line at time, executing each line as it is "translated," much the way a foreign language interpreter would translate a book, by translating one line at a time. Interpreters do generate binary code, but that code is never compiled into one program entity.

Interpreters offer programmers some advantages that compilers do not. Interpreted languages are easier to learn than compiled languages, which is great for beginning programmers. An interpreter lets the programmer know immediately when and where problems exist in the code; compiled programs make the programmer wait until the program is complete.

Interpreters therefore can be easier to use and produce more immediate results; however the source code of an interpreted language cannot run without the interpreter.

Compilers produce better optimized code that generally run faster and compiled code is self sufficient and can be run on their intended platforms without the compiler present.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

6y ago

Answer

A compiler only converts source code to binary code for direct execution after compilation is complete, while an interpreter converts source code to binary code in real time and executes the code on behalf of the source code. Generally, interpreted code runs slower but is easier to find and fix errors because of the shortened compilation times, and compiled source runs faster but takes longer to debug because of the potentially longer compilation times.

Answer

A compiler is a program that "compiles" a "compiled language" obviously, and an interpreter is a program that "interprets" an "interpreted" language. A compiled program must be made, built, like c++ for example. An interpreted language is taken and put right out as it is read (more or less) for example python.

To elaborate, a compiled language is taken as source, and then put into a make file, which is then used to make an executable file. The executable runs quickly because it's instructions are built in, they don't change, and the computer knows that.

An interpreted language is taken from the source, and run directly from source every time. So it takes longer to run an interpreted language because when a compiled language makes a permanent file and uses the same stuff to run quickly, an interpreted language has to read the source every time.

Think of it like this: A compiled program is like a piece of paper with instructions on it, and the instructions never change, so when you read them the first time you remember them and don't have to reread you can just do what they tell you again. (If they say cut an apple, and you do, then you're 'run' again and you have to do it again you don't have to look at the instructions)

But an interpreted language is like if you get a new piece of paper every time, so you have to read it every time to make sure it's the same or completely different. (The first could be cut an apple, the second could either be cut an apple or something like read a book but you don't know so you have to check)

Answer

Compiler manipulates the whole program as a single entity

Interpreter manipulates the program line by line

Compiler is very fast

Interpreter is comparatively slow

Answer

A compiler is a program that takes a programming language like that of Java and then translates it into computer language for the software user. The interpreter just (just like that of a human interpreter) takes the foreign language which would be that of the programming language and turns it into the machine code. Both of these programs take a high-level programming language and translates them into the machine code, but the interpreter is slower to translate than the compiler because of the fact it processes and interprets each statement many times.

Answer

compiler compiles (or changes your coding into machine language) at one go and at the end give you the list of errors on each and every line but the interpreter processes or converts the coding line by line. If there is any error in the line it will report it at the same time and the program execution cannot resume until that is rectified.

A compiler translates code from a source language (e.g. C, C++, Java) to a target language, which can then be executed by a (virtual or physical) machine.

An interpreter reads code in an interpreted language (e.g. PHP, Perl, JavaScript) and directly executes the contained instructions.

The main difference between interpreter and compiler is that interpreter execute code line by line while compiler execute the whole code at once.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

A compiler converts the source code to object code which then gets linked to the required header functions and start up code(varies from OS to OS) this then gets converted to executable code which then runs on the resources allocated to it by the operating system .. An interpreter generates an intermediate byte code which runs in the interpreter environment and is able to use the resources allocated to it by the interpreter environment , example of this is the java virtual machine .

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

A compiler translates high-level source code into low-level machine language but does not execute the resultant code during compilation. The resultant code can be executed only when the compilation is complete, but can be re-executed as often as required without recompiling. However, the resultant code is platform-dependant, specific to a particular type of machine architecture and operating system, unless the high-level code is itself the operating system kernel in which case it is entirely machine-dependant. Nevertheless, it is possible to craft the source code in such a way that it can be compiled upon different machine architectures and operating systems, such that the machine's compiler will filter the machine-dependant code appropriate to that specific platform.

An interpreter translates high-level code to low-level code, executing the code as it is translated. Every time the program is executed, the high-level code must be reinterpreted. Interpreted high-level code is much more portable than compiled code because the code simply requires a suitable interpreter for the machine on which it is executed. It is not machine-dependent. However, it is not possible to write low-level software such as operating system kernels using an interpreted language.


Compiled programs operate much more efficiently than interpreted programs because the compiler can take full advantage of the low-level hardware features of the machine and can optimise the machine code accordingly.


Some languages, like Java, are both compiled and interpreted. The compilation process translates the high-level Java source code into low-level byte code suitable for interpretation by the Java virtual machine which produces the actual machine code. These programs are more efficient than purely-interpreted programs, but not as efficient as purely-compiled languages. However, as with all interpreted languages, they are highly portable because the high-level Java code is specific to the Java virtual machine, a non-existent machine but one that is common across all physical platforms. In other words the programmer interacts with the virtual machine, not the physical machine.


This answer is:
User Avatar

User Avatar

Wiki User

7y ago

A compiler converts source code to machine language (or to some other specialized code, such as Java bytecode).An interpreter works directly with the source code, interpreting it one line at a time.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

an interpreter converts the source code to object code by doing a line at a time while a compiler does all at once.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

compiler -converts the program into byte code which is understood by the machine interpreter-translats the bytecode

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Compiler checks the error in whole program where as Interpreter just checks the error line by line .

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Interpreter deals with translations, and a compiler organize issues.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Different between compiler and interpreater
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is DML Compiler?

What is difference between Compiler and DML Compiler


What are the difference between a compiler design and a compiler?

In Compiler there is no design word ,whereas in compiler design there is design word


What does an interpreter do?

Interpreater translate the high level language into machine level language line by line


What is the difference between java compiler and C compiler?

Greetings Technologist. The Java compiler compiles Java code, whereas the C compiler compiles C Code HTH Richard Wolf Software Architect


What does building the compiler exactly means how does this differs from installing the compiler in perspective of GCC?

Installing a compiler, not just the gcc compiler, is a process where you copy the various executable files to the installation directory, where you copy the various header files to the include directory, where you copy the various library files to the lib directory, in short, where you install the compiler program and configure it so that it can do its work, namely to compile programs. This is no different than installing any other program, such as the game Myst. Building a compiler, on the other hand, is the process where you use a compiler, or other tools, to compile a set of programs that represents the compiler. If this sounds circular, consider this... The game Myst is a program. You install it in order to play it. When you run it, you load and run the executable code that represents Myst. It also has source code, though you probably can not get a copy of that source code. You build Myst by compiling the source code into object code, and then linking an executable from that object code. Building a compiler is no different. It is a program. It has source code. You build it by compiling the source code into object code, and then linking an executable from that object code. When you do this to a compiler, however, you need to distinguish between the compiler that you are building and the compiler that you are using to build the compiler. Sometimes, the compiler is used to compile a new version of itself, in a different directory. Sometimes, a different compiler is used, such as using a simplified version of C to compile a C++ compiler.


What is the different between Compiler and Interpreter in C or C plus plus programming?

It is easy to tell: there is no interpreter for C and C++, they are compiled languages.


What is comment in C?

Something that the compiler ignores.Comments are enclosed between /* and */.


How many types of compiler naming in list?

cross compiler . hybird compiler . post compiler. ideal compiler. intelligence compiler.


What is the difference between compiler and program?

A compiler is actually a program. However the function of a compiler it to take a programmers high level language code and render this as binary machine language instructions that a specific processor can execute.


How compiler differentiate between linear queue and circular queue?

It doesn't.


Difference between Apple Mac and Intel c compiler?

Apple provide the GCC (GNU Compiler Collection) compiler with their development tools which come free with the Mac OS X. Intel produce a version of their compiler for the Mac platform. For specific details see the links below.


Does c sharp work on c or c plus plus compilers or you need a c sharp compiler?

They are different languages, each of them requires its own compiler.