Top 6 Differences between Compiler and Interpreter
A compiler translates programming language into machine code & creates an executable file. It requires the entire code to be compiled before the execution.
An interpreter converts program statements into machine code & executes it line by line. It does not create an executable file & requires less time to execute than a compiler.
- Compiler executes the program after the entire program is compiled. - An interpreter executes the program after every line is evaluated, resulting in error execution line by line.
- A compiled program runs faster than an interpreted program since it consumes less time. - An interpreted program runs slower because it consumes more time.
- Compilation produces an output program that can run independently from source file. - Interpretation does not produce any output program & is evaluated every time program is executed.