174 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

Amity University | M.Tech Adm...
Apply
Ranked amongst top 3% universities globally (QS Rankings).
Shoolini University Admission...
Apply
NAAC A+ Grade | Ranked No.1 Private University in India (QS World University Rankings 2025)
Amity University Noida B.Tech...
Apply
Among Top 30 National Universities for Engineering (NIRF 2024) | 30+ Specializations | AI Powered Learning & State-of-the-Art Facilities
Amity University Noida MBA Ad...
Apply
Amongst top 3% universities globally (QS Rankings)
Amity University, Noida BBA A...
Apply
Ranked amongst top 3% universities globally (QS Rankings)
JSS University Noida MBA 2025
Apply
170+ Recruiters Including Samsung, Zomato, LG, Adobe and many more | Highest CTC 47 LPA
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