Difference Between Compiler and Interpreter | Compiler vs Interpreter



Follow @EngineersGarage

Home Subscribe


EG Labs


Invention Stories


Knowledge Base



Contact Us

Arduino Projects | Raspberry Pi | Electronic Circuits
USER LOGIN Username or e-mail: *

| AVR | PIC | 8051

| Electronic Projects

| How To

Difference Between Compiler and Interpreter

Password: *

Log in Create new account Request new password

Contributor: Shurvi Sisodiya

A Compiler and Interpreter both carry out the same purpose – convert a high level language (like C, Java) instructions into the binary form which is understandable by computer hardware. They are the software used to execute the high level programs and codes to perform various tasks. Specific compilers/interpreters are designed


for different high level languages. However both compiler and interpreter have the same objective but they differ in the way they accomplish their task i.e. convert high level language into machine language. Through this article we will talk about the basic working of both and distinguish the basic difference between compiler and interpreter.

Adapter Banana Jack Electric Beard Trimmer HDMI Cable Membrane Keypad Micro Switch Scientific Calculator SMPS Telephone Turbidity Sensor USB Connector ...more

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.

FEATURED ARDUINO PROJECTS Getting Started with Arduino LCD Arduino Interfacing Xbee Arduino Interfacing Interface GPS with Arduino Interface SD Card with Arduino Call using Keyboard, GSM & Arduino SPI Module of Arduino
... more arduino projects

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.

What is a Compiler



The main differences between compiler and interpreter are listed below: · The interpreter takes one statement then translates it and executes it and then takes another statement. · Compiler generates the error report after the translation of the entire page while an interpreter will stop the translation after it gets the first error. · Compiler takes a larger amount of time in analyzing and processing the high level language code comparatively interpreter takes lesser time in the same process.engineersgarage. All rights reserved.com/contribution/difference-between-compiler-and-interpreter 2/2 . Privacy Policy | Refund Policy | About Us Top http://www. Like Login or register to post comments 87135 reads 88 4 Tw eet 3 1 comment YOU ARE HERE Home Copyright © 2012 EngineersGarage.2/4/2014 Difference Between Compiler and Interpreter | Compiler vs Interpreter Outlining the basic working of the interpreter the above figure shows that first a source code is converted to an intermediate form and then that is executed by the interpreter. · Besides the processing and analyzing time the overall execution time of a code is faster for compiler relative to the interpreter. While the compiler translates the entire program in one go and then executes it.