Python Tutorials
Python Logo
What is Interepreter and Compiler?
▪︎ we generally write a computer program using a high-level language.A high-level language is one which is understandable by us humans.It contains words and phrases from the English language.
▪︎ But a computer does not understand high-level language.It only understands program written in 0's and 1's in binary,called the machine code.
▪︎ A program written in high-level language is called a source code.we need to convert the source code into machine code and this is actioned(accomplished)by "compilers" and "Interpreters".
▪︎ Hence,a compiler or an Interpreter is a program that converts program written in high-level language in to machine code understand by the computer.
Note:
â– Interpreted languages do not need to be compiled to run. A Program called an Interpreter will run python code on any kind of computer it can run on itself.
â– This means if the programmer needs to change the code they can quickly see the results.
â– This also means python is slower than a compiled language like 'c' , because it is not running machine code directly.
Differences between 'Interpreter' and 'Compiler' :
Get Techwala ðŸŽâ€™s stories in your inbox
Join Medium for free to get updates from this writer.
INTERPRETER:
• Translates program one statement at a time.
• It takes less amount of time to analyze the source code but the overall execution time is slower.
• No intermediate object code is generated, hence are memory efficient.
• Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy.
• Programming language like python , ruby use interpreters.
COMPILER:
• Scans the entire program and translates it as a whole into machine code.
• It takes large amount of time to analyze the source code but the over all execution time is comparitively faster.
• Generates intermediate object code which futher requires linking,hence requires more memory.
• It generates the error message only after scanning the whole program. Hence debugging is comparitively hard.
• Programming language like C, C++ use compilers.




