Differences between Compiler, Interpreter & Assembler
Compiler, interpreter and assembler
Compiler, interpreter and assembler are computer language translators. So, before knowing about compiler, interpreter and assembler, one needs some knowledge on programming languages. Modern programming languages are: C, C++, Java etc.
Difference between Compiler and Interpreter
Compiler | Interpreter |
Compiler translates an entire program into machine language to create an executable file | No executable file (object program) is generated |
Entire source program is executed at a time | Source programs are executed one line at a time (i.e., line-by-line)
|
Compiler looks at entire program | Interpreter only looks one line of program at a time |
Compiler is faster | Since interpreter translates line-by-line, interpreted code runs slower than compiled code. |
Takes longer to compile, but super fast execution | Immediate response, but execute slowly |
Errors are notified during compilation process | Errors are notified during interpretation process |
Disadvantage: harder to debug (i.e., finding errors) | Easier to debug (i.e., finding errors) |
Uses more memory | Interpreted code occupies little memory |
Once the program is compiled, it can be executed over and over without the source code or compiler | If program is interpreted the source code and interpreter are needed each time the program runs. |
The executable code runs faster | Interpreter is less efficient in execution than compiler |
Translates a source program to an executable (machine readable program) | convert a source program and execute it at the same time |
A language is compiled if the initial translation is complicated | A language is interpreted if the initial language is simple |
List of languages which use compilers are: COBOL, FORTRAN, Pascal, C, C++, Java. | List of languages which use compilers are: BASIC, Java, Perl, Python, Smalltalk
|
Difference between Compiler and Assembler
Compiler | Assembler |
Translates High Level Programs into machine programs | Translates Assembly Programs into machine programs |
Compiled programs are machine independent | Assembly programs are machine dependent |
Development of compilers is complex | Development of assemblers is easy |
Programmers do not have to know about computer hardware | Knowledge about computer hardware is essential |
List of languages which use compilers are: COBOL, FORTRAN, Pascal, C, C++, Java. | List of Assembly languages are: 8085, 8086 assembly languages, Z80, MC6800 programs |