What is the difference between an interpreter and a compiler? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference between an interpreter and a compiler?

9th Mar 2017, 9:19 PM
Chinemerem Okpuruka
Chinemerem Okpuruka - avatar
2 Answers
+ 3
Interpreters read and run each line of code at a time. Compilers read all the code, turn that whole batch into machine code and then run the program. Interpreters see errors when they eventually get to that wrong line of code. They also need to enterpret every time the program is run. Yet use less memory. Compilers see errors before running as all the code gets scanned first. The batch is compiled to a working program once and can be run anywhere anytime. Compilers use more memory though since the whole program need to be loaded.
9th Mar 2017, 10:13 PM
Anthony James Hiscock
Anthony James Hiscock - avatar
+ 3
is very simple the compiler turns your code into a thing called object file (if the language you work on it, that doesn't have a virtual machine - the reason for showing interpreter up- ) and an execute file (known as the application) for python, there is a compiler (the run time one also known as the dynamic compiler) and an interpreter for reading your code and run it on the machine summary they are totally different interpreter never ever compile your code just run the stuff that compiler produced in the first place
9th Mar 2017, 10:34 PM
Navid Tak
Navid Tak - avatar