diff --git a/README.rst b/README.rst index 1f024fd0..9939b6a1 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,44 @@ Byterun ------- -This is a pure-Python implementation of a Python bytecode execution virtual -machine. I started it to get a better understanding of bytecodes so I could -fix branch coverage bugs in coverage.py. + + +Byterun is a python interpreter written in just 1451 lines of Python. +Byterun's goal is to clearly explain Python's design. +If you want to better understand Python, or you are not quite sure how something in cPYthon works, then Byterun is a great place to start. +Byterun has proven very useful to a number of different projects, `including one by Google `_. + +By interpreter we mean a code execution virtual +machine. The Python compiler converts python source code into Python bytecode. The code execution virtual machine then executes that bytecode. + +There are a number of python virtual machines. Most Python developers use cPython. cPython includes a virtual machine written in C. Yes it runs Python very fast, but it is a large code base, and difficult to understand. Much better to start by studying Byterun. Then you can move onto cPython. + +If you are interested in Byterun, the first step is to read the +excellent introductory article on Byterun written by Alison +Kaptur. `A Python Interpreter written in Python `_ + +If you are not sure what a stack machine is, you might even start +with `the Wikipedia article on stack machines. `_ + +After understanding Alison's Byterun article, you should be able to make sense of +`the source code for this repository `_ +And from there you can move onto studying cPython, or PyPy, or Jython. + +In the process, you +will certainly need to refer to `the list of Python bytecodes `_ + +And as you get deeper into the code, you will need to refer to the `Python Execution Model `_ + +We invite you to join this community. What do you want to do with Byterun? Do you have any questions? + + +History +------- + +`Ned Batchelder `_, +`started Byterun `_ so that he could get a better understanding of bytecodes so that he could fix branch coverage bugs in `coverage.py `_. + +Byterun is based on pyvm2 written by Paul Swartz (z3p). + +