From 1ac5c00b15c1bacc16f293bf4dcc5c0e64583f64 Mon Sep 17 00:00:00 2001 From: Christopher Lozinski Date: Mon, 13 Mar 2017 11:25:39 +0100 Subject: [PATCH 1/7] Improved README.rst to be more welcome to new visitors. --- README.rst | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 1f024fd0..3dc1ba8f 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,25 @@ 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. If you want to better understand Python, Byterun is a great place to start. It 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. + +The first step is to read the excellent introductory article on Byterun written by Alison Kaptur. [A Python Interpreter written in Python](http://www.aosabook.org/en/500L/a-python-interpreter-written-in-python.html) + +I had to read it a number of times, each time I understood more. After understanding the article, you should be able to make sense of the code in this repository. And from there you can move onto studying cPython, or PyPy, or Jython. + +History +------- + +[Ned Batchelder](https://nedbatchelder.com/) [started Byterun](https://nedbatchelder.com/blog/201301/byterun_and_making_cells.html) so that he could get a better understanding of bytecodes so that he could fix branch coverage bugs in +[coverage.py](https://github.com/nedbat/coveragepy). + +Byterun is based on pyvm2 written by Paul Swartz (z3p). + +We invite you to join this community. + + From 494de3c9246f90cb77c908a3e8a3062d632f7d3d Mon Sep 17 00:00:00 2001 From: Christopher Lozinski Date: Tue, 14 Mar 2017 18:53:01 +0100 Subject: [PATCH 2/7] Further improved README.rst with additional links. Converted markdown to Restructured text, so links would display correctly. --- README.rst | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 3dc1ba8f..0a77c28e 100644 --- a/README.rst +++ b/README.rst @@ -1,15 +1,34 @@ Byterun ------- -Byterun is a python interpreter written in just 1451 lines of Python. If you want to better understand Python, Byterun is a great place to start. It has proven very useful to a number of different projects, including one by Google. +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. +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. -The first step is to read the excellent introductory article on Byterun written by Alison Kaptur. [A Python Interpreter written in Python](http://www.aosabook.org/en/500L/a-python-interpreter-written-in-python.html) +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 <../byetrun>` +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? -I had to read it a number of times, each time I understood more. After understanding the article, you should be able to make sense of the code in this repository. And from there you can move onto studying cPython, or PyPy, or Jython. History ------- @@ -19,7 +38,5 @@ History Byterun is based on pyvm2 written by Paul Swartz (z3p). -We invite you to join this community. - From c1bb558395d73002ccbab7a31b5cbd4dd7f20d20 Mon Sep 17 00:00:00 2001 From: Christopher Lozinski Date: Tue, 14 Mar 2017 19:00:01 +0100 Subject: [PATCH 3/7] Updated Hyperlinks. --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 0a77c28e..dffbd61c 100644 --- a/README.rst +++ b/README.rst @@ -12,11 +12,11 @@ machine. The Python compiler converts python source code into Python 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 ` +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. ` +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 <../byetrun>` From efc5a189be7428e61e315abb3cb1e73e32271b6e Mon Sep 17 00:00:00 2001 From: Christopher Lozinski Date: Tue, 14 Mar 2017 19:07:44 +0100 Subject: [PATCH 4/7] Fixed hyperlinks. --- README.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index dffbd61c..16ba83e3 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,8 @@ Byterun ------- + + 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. @@ -13,19 +15,19 @@ There are a number of python virtual machines. Most Python developers use cPyth 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 ` +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. ` +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 <../byetrun>` +_`the source code for this repository <../byetrun>`_ 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` +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 ` +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? @@ -33,8 +35,8 @@ We invite you to join this community. What do you want to do with Byterun? Do History ------- -[Ned Batchelder](https://nedbatchelder.com/) [started Byterun](https://nedbatchelder.com/blog/201301/byterun_and_making_cells.html) so that he could get a better understanding of bytecodes so that he could fix branch coverage bugs in -[coverage.py](https://github.com/nedbat/coveragepy). +_`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). From 3c4e2cfab7b58929be5ff19349b8daedb695f560 Mon Sep 17 00:00:00 2001 From: Christopher Lozinski Date: Tue, 14 Mar 2017 19:12:32 +0100 Subject: [PATCH 5/7] Now I fixed hyperlinks. --- README.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 16ba83e3..0efbc117 100644 --- a/README.rst +++ b/README.rst @@ -15,19 +15,19 @@ There are a number of python virtual machines. Most Python developers use cPyth 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 `_ +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. `_ +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 <../byetrun>`_ +`the source code for this repository <../byetrun>`_ 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`_ +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 `_ +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? @@ -35,8 +35,8 @@ We invite you to join this community. What do you want to do with Byterun? Do 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 `_. +`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). From 7b652ad68da06816bb6d3cea2f15f97130cc44f5 Mon Sep 17 00:00:00 2001 From: Christopher Lozinski Date: Tue, 14 Mar 2017 19:17:17 +0100 Subject: [PATCH 6/7] Finally fixed hyperlinks. --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 0efbc117..492807a5 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ Byterun 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. +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. @@ -25,7 +25,7 @@ After understanding Alison's Byterun article, you should be able to make sense 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`_ +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 `_ @@ -35,7 +35,7 @@ We invite you to join this community. What do you want to do with Byterun? Do History ------- -`Ned Batchelder `_ +`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). From 99347ef19541750c2fe325af6f2ea2a0a46d7af3 Mon Sep 17 00:00:00 2001 From: Christopher Lozinski Date: Tue, 14 Mar 2017 19:22:32 +0100 Subject: [PATCH 7/7] Fixed One More Link. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 492807a5..9939b6a1 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,7 @@ 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 <../byetrun>`_ +`the source code for this repository `_ And from there you can move onto studying cPython, or PyPy, or Jython. In the process, you