+ 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 !!