5 ms·
The difference between a virtual machine and an interpreter being?
by DasIch 11y ago
The difference between a virtual machine and an interpreter being?
- coldtea 11y agoMostly orthogonal. You can have an interpreter without a virtual machine (Basic or Python doesn't have one, just a runtime), and similarly a virtual machine without an interpreter. An interpreter executes scripting instructions directly. A virtual machine implements a faux (virtualized) cpu, with its instruction set etc, and executes its "assembly code" (with or without JITing). (Things get complicated in that you can also have combinations of those concepts).
- ihm 11y agoPython in CPython is executed after being compiled to the lower-level Python bytecode. Is this not sufficient to consider CPython to involve a virtual machine?
- DasIch 11y agoAlmost all interpreters compile an ast to an "assembly code" that gets executed. CPython even executes that assembly code without seeing the source at all just like Java.