Assembler, Interpreter and Compiler with differences

Computer languages can be grouped according to which translation process is used to convert the instructions into binary code.

Assembler: a program used to translate Assembly language programs. The entire program is assembled before the program is sent to the computer for execution.

Interpreter: A program used to translate high-level programs. Translates one line of the program into binary code at a time:
  1. An instruction is fetched from the original source code.
  2. The Interpreter checks the single instruction for errors.
  3. The instruction is translated into binary code.
  4. The binary coded instruction is executed.
  5. The fetch and execute process repeats for the entire program. 

Compiler: a program used to translate high-level programs.
Translates the entire program into binary code before anything is sent to the CPU for execution. The translation process for a compiled program:
  1. First, the Compiler checks the entire program for syntax errors in the original source code.
  2. Next, it translates all of the instructions into binary code. - Two versions of the same program exist: the original source code version, and the binary code version (object code).
  3. Last, the CPU attempts execution only after the programmer requests that the program be executed.




Interpreter Vs Compiler:
  1. A compiler converts the high level instruction into lower level language (e.g., assembly language or machine code) while an interpreter converts the high level instruction into an intermediate form.
  2. The compiler executes the entire program at a time, but the interpreter executes each and every line individually.
  3. List of errors is created by the compiler after the compilation process while an interpreter stops translating after the first error.
  4. Autonomous executable file is generated by the compiler while interpreter is compulsory for an interpreter program.
  5. Interpreter is smaller and simpler than compiler
  6. Interpreter is slower than compiler.