+ 1
What is the difference between compiler and interpreter?
Recently joined the challenge. Not a big fan of programming, but I wondered what actually is the compiler and interpreter? Are they same?
3 Answers
+ 5
Interpreterā”ļø
Translates program one statement at a time.
compilerā”ļø
Scans the entire program and translates it as a whole into machine code.
interpreterā”ļø
It takes less amount of time to analyze the source code but the overall execution time is slower.
compilerā”ļø
It takes large amount of time to analyze the source code but the overall execution time is comparatively faster.
interpreterā”ļø
No intermediate object code is generated, hence are memory efficient.
compilerā”ļø
Generates intermediate object code which further requires linking, hence requires more memory.
interpreterā”ļø
Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy.
compilerā”ļø
It generates the error message only after scanning the whole program. Hence debugging is comparatively hard.
+ 1
A Compiler usually translates your code in CPU instructions, a interpreter just reads the code and executes it directly (which is slower than a compiled program, but maybe more flexible)
+ 1
@Brains !! Thanks dude ! This is helpful for us too !!