What is a python virtual machine?

little bottle
Release: 2019-05-30 16:08:26
Original
9333 people have browsed it

What is a python virtual machine?

There are two definitions of virtual machines, one is a system virtual machine similar to Vmware, and the other is a virtual machine called a program virtual machine, such as JVM and CLR are the most common virtual machines.

But python does not have its own dedicated virtual running PC (JRE) like java. python needs to have its own interpreter (such as: Cpython) to execute the bytecode one by one like a CPU. . Because Python is more of an interpreted language, while Java is more of a compiled language.

The concept of an interpreter is relatively simple. It can translate and run the code without compilation. The interpreter in the JVM is officially like this. What is interpreted in the JVM is the bytecode.

There are three ways for the interpreter to run a program:

1. Directly run a high-level programming language (such as the Shell's built-in interpreter)

2 , Convert high-level programming language code to some efficient bytecode (Bytecode), and run these bytecodes

3. Compile the high-level language with the compiler included in the interpreter, and instruct the processor to run the compilation The subsequent program (for example: JIT)

The above is the detailed content of What is a python virtual machine?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template