While using python language, I just got curious why interpreter language is comparatively slower than compiler language. According to Googling, it says it's because interpreter language targets code to executes on Virtual Environment while compiler language targets Physical Environment. Then, one of my friend brought new opinion. He said while compiler language makes objective code which can reduce lots of unnecessary parts of code and increase execution speed which also can be called as optimization, interpreter language executes line by line. Which one is the main reason? Even both are right?
Asked
Active
Viewed 104 times
0
-
1Possible duplicate. There's a popular there [here](https://stackoverflow.com/questions/3265357/compiled-vs-interpreted-languages) – compor Jul 04 '19 at 09:29
-
3Possible duplicate of [Compiled vs. Interpreted Languages](https://stackoverflow.com/questions/3265357/compiled-vs-interpreted-languages) – flau Jul 04 '19 at 09:42
-
Becasue the fetch cycle happens in software rather than hardware, – user207421 Jul 04 '19 at 09:44
-
And I don't see anything in the supposed duplicate that actually addresses this question adequately, or indeed that gets anything right whatsoever. And the quesiton is not too broad, it is has one very simple ten-word answer, – user207421 Jul 04 '19 at 11:42
-
What is a Compiled/Interpreted Language? See PyPy and Nuitka, for example of Compilation of Python. See Ch for example for a C interpreter. – Aron Jul 05 '19 at 08:39
1 Answers
0
Basically...
As you pointed out, and in your references, compiled code results in machine code which is as close as you can get to the physical machine processor(s) and memory.
Whereas an interpreter, itself which may be machine code, parses your expressions in order to run the resultant, albeit pseudo, code to produce the expressions result. The key here is that there is an additional layer (parse and execute) at runtime that adds overhead and effects performance.

Frank C.
- 7,758
- 4
- 35
- 45
-
There is no evaluate step. The steps are fetch-execute-increment PC. The execute step is identical in interpreters and compiled cde. The other two aren't. – user207421 Jul 05 '19 at 00:52