Home » Articles/Editorial

Complier Vs Interpreter | Difference between Compiler and Interpreter

By: IncludeHelp, on 06 AUG 2016

Compiler and Interpreter Differences

Both are the Computer Programming Language Translators, still they have differences; here we will learn what are the compilers and interpreters and what are the differences between them.

Compilers and Interpreters are the system softwares (programming language translators) which are used to convert program that are written in high level programming language into machine level code.

Compiler

A compiler is a programming language translator which converts High Level Language program to its equivalent Intermediate Code. Compiler read complete program once and compiles complete code.

Interpreter

An Interpreter is a programming language translator which converts High Level Language program to its equivalent Machine Code. Interpreter reads program line by line or we can say statement by statement and if statement is error free, it converts into machine code.

Differences:

Compiler Interpreter
Compiler generates an Intermediate Code. Interpreter generates Machine Code.
Compiler reads entire program for compilation. Interpreter reads single statement at a time for interpretation.
Compiler displays all errors and warning at time and without fixing all errors program cannot be executed. Since Interpreter reads single statement so an interpreter display one error at a time and you have to fix the error to interpret next statement.
Compiler needs more memory because of object (an intermediate code) generation, every time when program is being compiled an intermediate code (object code) will be generated. In comparison to Complier, an Interpreter needs less memory to interpret the program as interpreter does not generate any intermediate code, it direct generates machine code.
The programming languages which use Compilers – C, C++, (.Net also has compilers for different languages and generates MSIL code, MSIL code further converts into Machine Code using JIT Compiler). The programming languages which use Interpreters – Ruby, Python

Other types of Programming Translators (Compilers, Interpreters)

Source To Source Compiler
Special type of programming translators that converts a high level language program to another high level language program known as source to source compiler.

Decompiler
The programming language translator that convert an Intermediate Code or Machine Code into a high level language program known as Decompiler.

Assembler
Programming Language Translator that converts Assembly program to its equivalent Machine Code known as Assembler.

Disassembler
Programming Language Translator that converts Machine Code into its equivalent Assembly Code known as Disassembler.


Some of the popular Compilers: For C, C++ programming: gcc, g++, Borland TurboC

Some of the popular Interpreters: Python, Basic, Java

Related Articles



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.