Compiler Interpreter Assembler Debugger

What is an Compiler?
In general, compiler is a computer program that reads a program written in one language, which is called the source language, and translates it in to another language, which is called the target language. Traditionally, source language is a high level language such as C++ and target language is a low level language such as Assembly language. However, there are compilers that can convert a source program written in Assembly language and convert it to machine code or object code. Assemblers are such tools. On the other hand, Interpreters are tools that execute instructions written in some programming language. Interpreter can either directly execute high level source code or translate them to intermediate code and then interpret it or execute precompiled code.


What is an Assembler?
Assembler is software or a tool that translates Assembly language to machine code. So, an assembler is a type of a compiler and the source code is written in Assembly language. Assembly is a human readable language but it typically has a one to one relationship with the corresponding machine code. Therefore an assembler is said to perform isomorphic (one to one mapping) translation. Advanced assemblers provide additional features that support program development and debugging processes. For example, the type of assemblers called macro assemblers provides a macro facility.


What is an Interpreter?
An interpreter is a computer program or a tool that executes programming instructions. An interpreter may either execute the source code directly or converts the source to an intermediate code and execute it directly or execute precompiled code produced by a compiler (some interpreter systems include a compiler for this task). Languages like Perl, Python, MATLAB and Ruby are examples of programming languages that use an intermediate code. UCSD Pascal interprets a precompiled code. Languages like Java, BASIC and Samltalk first compile the source to an intermediate code called bytecode and then interpret it.



What is a Debugger?
Debugger is a computer program that is used to find bugs/errors in other programs. Debugger allows executing a program and inspecting each step in the program execution. It also allows stopping the execution of the program at some point and changing some variable values and then continuing the execution. All of these capabilities are provided to help the programmer to make sure that her program is behaving correctly and to help in identifying bugs in the code. Most of the debuggers provide the ability to execute a program step by step (also called single stepping), pausing to examine the current state of the program by providing a breakpoint and tracking variable values. Some advanced debuggers allow the programmer to skip a location that causes a crash or a logical error in the code and continue execution from a different location. Some of the popular debuggers are GNU Debugger (GDB), Microsoft Visual Studio Debugger, etc.



Compiler  V/s Interpreter V/s Assembler


Compiler
1.Compiler translates a high level language program into machine level language.
2.translates each high level language instruction into a set of machine level instructions
3.one to many correspondence.
4.Examples are C, COBOL, Java, etc. .

Interpreter
1.Compiler translates a high level language program into machine level language.
2.It takes one statement of a high level language program, translates it into machine language instructions and immediately executes it.
3.a one to one relationship with the corresponding machine code
4.Languages like Java, BASIC and Samlltalk first compile the source to an intermediate code called bytecode and then interpret it.


Assembler
1.Assembler translates a assembly language program into machine level language.
2.It takes one statement of a assembly language program, translates it into machine language instructions and immediately executes it.
3.typically has a one to one relationship with the corresponding machine code