No | Compiler | Interpreter |
---|---|---|
1 | Compiler Takes Entire program as input | Interpreter Takes Single instruction as input . |
2 | Intermediate Object Code isGenerated | No Intermediate Object Code isGenerated |
3 | Conditional Control Statements are Executes faster | Conditional Control Statements are Executes slower |
4 | Memory Requirement : More(Since Object Code is Generated) | Memory Requirement is Less |
5 | Program need not be compiledevery time | Every time higher level program is converted into lower level program |
6 | Errors are displayed after entire program is checked | Errors are displayed for every instruction interpreted (if any) |
7 | Example : C Compiler | Example : BASIC |
Explanation : Compiler Vs Interpreter
Just understand the concept of the compiler and interpreter -
- We give complete program as input to the compiler. Our program is in the human readable format.
- Human readable format undergoes many passes and phases of compiler and finally it is converted into the machine readable format.
- However interpreter takes single line of code as input at a time and execute that line. It will terminate the execution of the code as soon as it finds the error.
- Memory requirement is less in Case of interpreter because no object code is created in case of interpreter.
Following video will say much more about compiler -
No comments:
Post a Comment