Knowee
Questions
Features
Study Tools

Write any 5 difference between compiler and interpreter.

Question

Write any 5 difference between compiler and interpreter.

🧐 Not the exact question you are looking for?Go ask a question

Solution

  1. Execution Time: A compiler takes the entire program and translates it into object code which is typically stored in a file. The object code is also known as binary code and can be directly executed by the machine after linking. An interpreter, on the other hand, translates program one statement at a time. It reads one statement from the source code, translates it to the machine code or an intermediate code, then executes it, and then proceeds to the next statement. This continues until all the statements are not executed.

  2. Error Detection: In a compiler, all the errors of the program are shown after the compilation of the program. But in an interpreter, the errors are shown for every line interpreted. The interpreter stops at the line where the error is detected and continues only after the error is rectified.

  3. Memory Requirement: A compiler requires more memory than an interpreter because it needs to store the object code. On the other hand, an interpreter is less memory intensive as it directly executes the source code line by line.

  4. Efficiency: Programs compiled using a compiler are more efficient than the ones interpreted because the compiled code is a translation of the high-level language into machine language. But in an interpreter, the source code is directly executed line by line which makes it less efficient.

  5. Portability: The compiled code is not portable. It is machine dependent and changing the machine requires the code to be recompiled. On the other hand, the source code in an interpreter is easily portable. It is machine independent and does not require recompilation on changing the machine.

This problem has been solved

Similar Questions

compiler and interpreter

You're an university student pursuing Computer Science.Differentiate between compiler and interpreter.give 7 points including examples and show in a tabular form.

Differentiate between compiler,interpreter and assembler

Which of the following describes a compiler

Describe two advantages of an interpreter overa compiler.

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.