0
What is the difference between an interpreter and a compiler?
2 Respostas
+ 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.
+ 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