S.no. | Compiler | Interpreter |
---|---|---|
1 | A compiler translates the complete source program in a single run. | An interpreter translates the source program line by line. |
2 | It consumes less time. | It consumes more time than the compiler. |
3 | It is faster. | It is slower. |
4 | It is more efficient. | It is less efficient. |
5 | It is not flexible. | It is flexible. |
6 | Compilers are larger in size. | Interpreters are often smaller than compilers. |
7 | The error localization is difficult. | The error localization is easier than the compiler. |
8 | CPU utilization is more. | CPU utilization is less as compared to compilers. |
10 | Both syntactic and semantic errors can be checked at the same time. | Only syntactic errors can be checked at a time. |
11 | A presence of an error may cause the whole program to be reorganized. | A presence of an error causes only a part of the program to be reorganized. |
12 | A compiler does not provide an improved debugging environment. | An interpreter provides an improved debugging environment. |
13 | The compiler is used by languages such as C. C++ etc. | An Interpreter is used by languages such as Java. |
What is Compiler & interpreter