Now we don’t in a general write computer program by using the 0 and 1. We generally write a computer program using the high-level programming language. All you already know about that the High-level programming language is under stable by the human. I mean the source code is understandable by the human.
But the computer does not understand the high-level language. The computer only can understand the ‘0’ and ‘1’. That’s means the computer only can understand the binary. The binary is also known as the machine code.
Now the question, we are writing the codes in a high-level language, but to understand by the computer it must need to convert it to machine language. This work is done either by the compiler or by the interpreter. Compiler and Interpreter both are used to convert a program that we write in a high-level language. Though they do the same tasks, but they have some difference also.
Here we sill discuss some of their differences
1. Compiler: The compiler takes the entire program at a time for translation.
Interpreter: The Interpreter takes a single line code at a time for translation.
2. Compiler: After taking the entire programs at a time compiler generates intermediate object code.
Interpreter: After taking the entire program the Interpreter does not produce any intermediate code.
3. Compiler: The compiler completes its compilation fully before execution.
Interpreter: The compilation and the execution off an input data take place simultaneously.
4. Compiler: The procedure of compilation is faster than Interpreter.
Interpreter: The procedure of Interpretation is slower than the compiler.
5.Compiler: At compiler, it creates an object code, that’s why need more memory
Interpreter: In Interpreter, no intermediate object code is created. That’s why need less memory.
6.Compiler: After compilation, all the errors display at the same time.
Interpreter: Displays error of each line one after another.
7.Compiler: Some compiler-based languages are C, C++, c#, Scale and more.
Interpreter: Some Interpreter based languages are PHP, Perl, Python, Ruby and more.