Showing posts with label General interview questions. Show all posts
Showing posts with label General interview questions. Show all posts
Monday, 10 June 2013
Monday, 15 April 2013
Difference between compiler and interpreter
Compiler
A compiler is a piece of code that translates the
high level language into machine language. When a user writes a code in a high
level language such as Java and wants it to execute, a specific compiler which
is designed for Java is used before it will be executed. The compiler scans the
entire program first and then translates it into machine code which will be
executed by the computer processor and the corresponding tasks will be
performed.
Shown in the figure is basic outline of the
compilation process, here program written in higher level language is known as
source program and the converted one is called object program.
Interpreter
Interpreters are not much different than compilers.
They also convert the high level language into machine readable binary
equivalents. Each time when an interpreter gets a high level language code to
be executed, it converts the code into an intermediate code before converting
it into the machine code. Each part of the code is interpreted and then execute
separately in a sequence and an error is found in a part of the code it will stop
the interpretation of the code without translating the next set of the codes.
The differences between compiler and interpreter
are :-
Subscribe to:
Posts (Atom)