Technical Discussion :: Operating System
Home > Technical Interview Q&A > Operating System > Discussion
8 / 91
Differentiate between compiler and interpreter?
Answer:
Interpreter | Compiler |
---|---|
Translates program one statement at a time. | Scans the entire program and translates it as a whole into machine code. |
It takes less amount of time to analyze the source code but the overall execution time is slower. | It takes a large amount of time to analyze the source code but the overall execution time is comparatively faster. |
No intermediate object code is generated, hence are memory efficient. | Generates intermediate object code which further requires linking, hence requires more memory. |
Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy. | It generates the error message only after scanning the whole program. Hence debugging is comparatively hard. |
Programming language like Python, Ruby use interpreters. | Programming language like C, C use compilers. |
Asked In ::
ZEESHAN ALI
13 Oct, 2019 1:07 PM
Interpreter | Compiler |
---|---|
Translates program one statement at a time. | Scans the entire program and translates it as a whole into machine code. |
It takes less amount of time to analyze the source code but the overall execution time is slower. | It takes a large amount of time to analyze the source code but the overall execution time is comparatively faster. |
No intermediate object code is generated, hence are memory efficient. | Generates intermediate object code which further requires linking, hence requires more memory. |
Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy. | It generates the error message only after scanning the whole program. Hence debugging is comparatively hard. |
Programming language like Python, Ruby use interpreters. | Programming language like C, C use compilers. |