+ 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 ответов
+ 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 !!