.
Compiler
Compiler is program that translate a high level language into machine language. A compiler makes translation once so that the source code does not have to translated such time the program is run. Source code translate into the machine code is called object code.
Compiler takes the complete high level program (source code) as input and translates it in terms of machine level instruction (object code). Compiler checks the entire user written program known as source program, if error free, produces a complete program in machine language known as object program. The examples of common compilers are C, C++, Java, Pascal, FORTRAN etc.
Interpreter
Interpreter is a program that translate the high level language into machine language. Every time program is run the interpreter must translate each object code again. Interpreter reads each line of the programmer's instructions, determines what they mean, and sends the appropriate 1's and 0's to the computer.
The interpreter needs to evaluate the program letter by letter, then word by word, then line by line it's an incredibly slow process. Since translation is done on each line, error information is provided if any. The interpreter does not generate executable program. Therefore the distribution of the program is done by providing the source code. Example of Interpreter are ABASIC, GWBASIC, PERL etc.
Assembler
Assembler is a computer program which is used to translate program written in Assembly language into machine language. The translated program is called object program. It check each instruction for correctness and generate diagnostic massage if there mistake in syntax.
Assembler is basically the first interface that is able to communicate humans with the machine. We need an Assembler to fill the gap between human and machine so that they can communicate with each other. Code written in assembly language is some sort of mnemonics(instructions) like ADD, MUL, MUX, SUB, DIV, MOV and so on. and the assembler is basically able to convert these mnemonics in Binary code. Example of Assembler are GAS, GNU etc.
Comments
Post a Comment