Compiler, Assembler, and Interpreter

We have discussed the compiler. Now let’s talk a little bit about interpreter and assembler. Assembler and Interpreter are not related things to C Programming.

We can categorize high-level programming languages as either compiled type or interpreted type. C is compiled type, whereas there exists another type called interpreted type.

Interpreter

If the programming language is interpreted type then the execution of instructions into a machine goes differently.

In this type, the conversion/translation and execution of the program occur immediately one statement at a time. Thus the program that converts each high-level program statement into a machine code just before the program is to be executed is called an interpreter. Now let’s have a look at the difference between interpreter and compiler.

Compiler
Interpreter
I) Converts all the statements in source to object code and finally in executable code resulting in an exe file.I) It converts each statement before executing it. Does not produce a final executable file.
II) It requires some time before producing an executable file.II) Can execute program immediately.
III) Once compiled then no need to recompile for the next run. So, the executables are much faster and more efficient.III) For the next run, it is required to repeat the process from the beginning.
IV) Immediate editing and executing the program is costly because it takes a long time for compilation if the program is long.IV) Possible to execute the edited program immediately. So, used for the software development phase and learning for students.
V) Example: C, C++, FORTRAN, etc.V) Example: Basic, Lisp, Javascript, etc.
Difference between Compiler and Interpreter

Assembler

This concept is for assembly language programming. They also convert programs written in assembly language mnemonics to machine codes.

Firmware

Software embedded in hardware, that acts as an interface between software and hardware. For example The BIOS in computers, Device Drivers, etc.