Compiler and Interpreter

We generally write a computer program using a high-level language. A high-level language is one that is understandable by us, humans. This is called source code.

However, a computer does not understand high-level language. It only understands the program written in 0's and 1's in binary, called the machine code.

To convert source code into machine code, we use either a Compiler or an Interpreter.


 Compilers and Interpreters are used to convert a program written in a high-level language(Java,Python) into machine(Binary code 0,1) code understood by computers. 


Differences Between Interpreter and Compiler :

Interpreter :

1- Programming languages like                    JavaScript, Python, Ruby use                      interpreters.

2- There is not intermediate object                code  generated, hence are memory        efficient.

3- Interpreters  take less  time to                    analyze the source code. However,          the overall execution   time is                    comparatively slower than                        compilers.    

Compiler :

1-  Scan the entire program and translates it as a all into machine code.

2- Programming languages like C, C++, Java use compilers.

3- Compiler generates intermediate object  which  requires linking, hence take more                  memory.                                           


Comments

Post a Comment

Popular posts from this blog

What is Java

What is Python

Digital Marketing