173 Views

Interpreter Vs Compiler : Differences Between Interpreter and Compiler


Maheswari 24th Jul, 2021
Answers (3)
Ambika Ray 7th Nov, 2021

Computer programming languages are classified into 3 categories:
1. Machine language,
2. Assembly language, and
3. High level language.
Computers can not understand high level language or assembly language.
Computers only understand the machine language.
As a result, we need a translator, which converts a program written in high level language or assembly language (source code) into machine language (object code).
A compiler or an interpreter is a program that translates high-level languages (source code) into machine language (object code).
A compiler converts the entire program into machine code at one go.
An interpreter translates the source code line by line, that is, it would execute the current statement before translating the next statement.

There are also other differences,

For details please visit the site:

https://youtu.be/Iu9qf0U3whA


ginnisachdeva02_9364270 Student Expert 24th Jul, 2021

Hi Aspirant!

As we know that the machine only understands the binary language, that is the language written in 0's and 1's, called the machine code for a program. To convert source code into machine code, we use either a compiler or an interpreter. Difference between interpreter or compiler:

  • Interpreter translates program one statement at a time and compiler scans the entire program and translates it as a whole into machine code.
  • Interpreter takes less time to analyse the source code , but the execution time is more than that of compiler. For compiler it is vice-versa.
  • No Object Code is generated in case of interpreter, hence are memory efficient. While compiler generates Object Code which further requires linking, hence requires more memory.
  • Example of language which use compilers are java, C, C++ and for interpreters it is JavaScript, Python, Ruby, etc.


Thankyou!

Rajeswari 24th Jul, 2021

Hello,

To convert source code into machine code we use either a compiler or an interpreter

Both compilers and interpreters are used to convert a program written in a high level language into machine code understood by computers there are differences between how an interpreter & a compiler works

Interpreter -

•Interpreters usually take less amount of time to analyze the source code the overall execution time is comparatively slower than compilers

•Programming languages like JavaScript Python Ruby use interpreters

•Translates program one statement at a time

Compiler -

•Compilers usually take a large amount of time to analyze the source code the overall execution time is comparatively faster than interpreters

•Programming languages like C Java use compilers

•Scans the entire program & translates it as a whole into machine code

Hope it helpful.

Thankyou.

Related Questions

MAHE Manipal M.Tech 2025
Apply
NAAC A++ Accredited | Accorded institution of Eminence by Govt. of India | NIRF Rank #4
Graphic Era (Deemed to be Uni...
Apply
NAAC A+ Grade | Among top 100 universities of India (NIRF 2024) | 40 crore+ scholarships distributed
Indrashil University | B.Tech...
Apply
Apply for B.Tech | AICTE Aproved | UGC Recognized | International Collaborations for Global Edge | 100% Placement Assistance
JSS University Mysore BBA Adm...
Apply
NAAC A++ Accredited| Ranked #24 in University Category by NIRF
Sharda University Admissions ...
Apply
North India's Largest Educational Group | NIRF Ranked 86 | NAAC A+ Grade | Highest Package 1.6 Cr | Scholarships upto 100% | Pay Rs.500 instead of ...
UPES B.Tech Admissions 2025
Apply
Ranked #42 among Engineering colleges in India by NIRF | Highest Package 1.3 CR , 100% Placements | Last Date to Apply: 18th May
View All Application Forms

Download the Careers360 App on your Android phone

Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile

150M+ Students
30,000+ Colleges
500+ Exams
1500+ E-books