Without describing what a compiler and an interpreter is,explain the difference between a compiler and an interpreter,including their advantage.
Solution
Answer:-
Compiler
- the compiler would translate the entire source code into amachine language
- It creates internal structure in memory
Advantages of the compiler:
- Since compilation is a one-timer, compilers usually put moreeffort into optimizations and thus executes faster even aftertranslation
- The entire program is verified so there are no syntax orsemantic errors
Interpreter
- the interpreter would read the program text character bycharacter
- The results are printed immediately on the console
Advantages of Interpreter
- Source code is multi-platform. Compiled code isprocessor-specific
- Program can be executed before is finished so you gat partialresults early