Difference between compiler and interpreter

Compiler
  • convert source (high level )language to Target language at a time
  • shows error after complete compilation
  • less time consuming if codes are smaller
  • space complexity is high
  • less efficient for a small program
  • execute conditional code statement and logical statement faster
  • generate intermediate object code for which it require more memory allocation
  • e.g C, C++, etc.


Interpreter
  • convert source (high level )language to Target language line by line
  • shows error during run time of each line and when error found it stop debugging
  • takes less time to analyze source code but overall processing is slow
  • memory efficient as it takes less memory
  • eg : python, ruby

No comments:

Post a Comment