Lets discuss both Interpreted and Compiled languages in context of programming.
Interpreted | Compiled |
---|---|
The code is run from top to bottom | Structure/procedure oriented programming languages like C follows top down approach. Whereas object oriented programming languages like C++ and Java follows bottom up approach |
Result after running the code is immediately returned | Result is not immediately returned |
No transformation of code is required to run it | Transformation of code (compilation to machine code) is required to run it |
Takes single instruction as single input and executes instructions | Converted directly into machine code that the processor can execute |
Slower than compiled languages | Faster and more efficient to execute than interpreted languages |
Memory requirement is less. | Memory requirement is more due to the creation of object code. |
Error are displayed for every single instruction | Error are displayed after the entire program is compiled |
Source Code ---> Interpreter ---> Output | Source code ---> Compiler ---> Machine Code ---> Output |
Example: Perl, Python, Matlab | Example: C, C++ |