2 Answers | Add Yours
The instructions that a computer's hardware is able to understand are in the form of binary code which is a series of zeros and ones. When computers were invented all programming was done by creating computer binary code. This was a very slow, tedious and error prone process. To make programming easier higher level programming languages were introduced which include COBOL, BASIC, etc.
There are two ways by which code written in high level programming languages can be converted to binary code which is executed by the computer hardware. One of them makes use of compilers. These directly convert the instructions into machine language once the program has been fully typed. The output of compilers is specific to the machine and is usually suitable for use on only one configuration of operating systems.
Interpreters on the other hand convert the instructions that are provided by a programmer into a form of code that differs from binary code. As the program is executed each line is interpreted. This makes it easier to debug a program as the programmer does not have to wait till the entire program has been typed. The code that is delivered by the interpreter is converted to machine code through a separate program that has to be present on the machine which compiles the code each time the program is run. This makes it possible to have the same program run on machines with different operating systems.
Simply, they both use for the same purpose but the way of achieving the purpose is the deferent, Interpreter takes line by line of code and checks it for errors, and then execute it while Compiler takes entire program and checks for errors, compile the program, and then execute it.
We’ve answered 318,980 questions. We can answer yours, too.Ask a question