|
Compiler vs. Interpreter
|
View this Thread in Original format
| UglyDave |
What's the difference between the two?
My current understanding is that and interpreter takes code line by line and executes it?
Compiler is more dynamic, changes the languare into binary code then executes??
Thanks!
David |
|
|
| electric_soul |
| quote: | "Compilers produce machine language versions of programs. The compiled program is executed as a single unit.
Instead of translating the program as a unit, an interpreter translates the individual steps in the high--level program when it is run, so that it appears to be executed exactly as it is written.
Interpreted programs run a lot slower than compiled ones. This is because it is necessary to perform an amount of translation for every single step, whereas the compiled program is translated as a whole once and for all. However, interpreters are useful when developing programs, because it is possible to follow the execution to the point where it fails." |
Just cut&pasted from somewhere, tho I disagree with intepreted programs run a lot slower.
Depending on context there is caching of byte-code ("machine language"), and lots of tweaks and hacks and glitches and loads of things programmers did to improve performance of interpreted languages (such as DBase, Perl, Python, PHP, etc). Also CPU power and mem has gone cheaper and faster. Sometimes going for compiler is the wrong way, sometimes going for interpreter is the wrong way.
It all depends on the task to accomplish. |
|
|
| UglyDave |
thank you very very much!
What site did u get that from??
Tried searching but to no avail! |
|
|
| UglyDave |
Thanks very very much! very nice of you to go to the effort!
Thanks again,
Davo |
|
|
|
|