Python is an interpreted language; When a program is run, the python interpreter is first parsing your code and checking for any syntax errors, then i

MoserMichael / pyasmtool Public

submited by
Style Pass
2022-01-15 11:30:11

Python is an interpreted language; When a program is run, the python interpreter is first parsing your code and checking for any syntax errors, then it is translating the source code into a series of bytecode instructions; these bytecode instructions are then run by the python interpreter. This text is explaining some of the features of the python bytecode.

This article looks at cpython, which is the reference implementation of the python interpreter. Most people are probably running cpython (that's what you get with brew install python3 on the Mac). If you are talking about the latest and greatest versions of python, then use of the CPython interpreter is implicitly assumed. However there is a drawback, CPython doesn't have a just in time compiler right now, instead the interpreter is running the bytecode instructions directly.

There is a competing python runtime PyPy. This one does have a just in time compiler that translates the bytecode into machine code on the fly, while running your programm. PyPy is therefore several times faster than CPython in most benchmark tests. However it is normally playing catch up with CPython, and is normally a few minor versions behind the CPython release cycle.

Leave a Comment
Related Posts