A compact Python Interpreter written in Python.
- Byterun is a compact Python interpreter - a software that emulates a physical computer.
- Byterun is a Python interpreter written in Python.
- The Python interpreter is a virtual machine, in particular a stack machine - it manipulates several stacks to perform its operations.
- Working and structure of Python interpreter CPython
- Stack machine
- Python OOP
There are four kinds of objects in Byterun:
- The
VirtualMachineclass manages the highest level structure. - Manages the call stack of frames and contains a mapping of instructions to operations.
VirtualMachinestores the call stack, the exception state, and return values while they're being passed between frames.
- Every
Frameinstance has one code object. - Manages:
- The local, global, and builtin namespaces.
- A reference to the previous frame.
- A data stack.
- A block stack.
- The last instruction executed.
- Creates a new frame in the interpreter everytime a function is called.
- Controls the creation of new
Frameobjects.
- A
Blockjust wraps the three attributes of blocks -type,handlerandstack_height - A
Blockis used for flow control, specifically exception handling and looping.
Distributed under the MIT License. See LICENSE.md for more information.
