Compiler and Interpreter
We generally write a computer program using a high-level language. A high-level language is one that is understandable by us, humans. This is called source code.
However, a computer does not understand high-level language. It only understands the program written in 0's and 1's in binary, called the machine code.
To convert source code into machine code, we use either a Compiler or an Interpreter.
Interpreter :
1- Programming languages like JavaScript, Python, Ruby use interpreters.
2- There is not intermediate object code generated, hence are memory efficient.
3- Interpreters take less time to analyze the source code. However, the overall execution time is comparatively slower than compilers.
Compiler :
1- Scan the entire program and translates it as a all into machine code.
2- Programming languages like C, C++, Java use compilers.
3- Compiler generates intermediate object which requires linking, hence take more memory.
Nice content
ReplyDelete