Differentiate between a compiler and an interpreter.
Answers
Differentiate between a compiler and an interpreter.
Interpreter translates just one statement of the program at a time into machine code. Compiler scans the entire program and translates the whole of it into machine code at once. An interpreter takes very less time to analyze the source code. A compiler always generates an intermediary object code.
Answer:
Interpreter Compiler
Translates program one statement at a time. Scans the entire program and translates it as a whole into machine code.
Interpreters usually take less amount of time to analyze the source code. However, the overall execution time is comparatively slower than compilers. Compilers usually take a large amount of time to analyze the source code. However, the overall execution time is comparatively faster than interpreters.
No intermediate object code is generated, hence are memory efficient. Generates intermediate object code which further requires linking, hence requires more memory.
Programming languages like JavaScript, Python, Ruby use interpreters. Programming languages like C, C++, Java use compilers