Byte-run: a Python interpreter written in Python

BartC bc at freeuk.com
Fri Jan 13 14:25:00 EST 2017


On 13/01/2017 18:47, Ian Kelly wrote:
> On Fri, Jan 13, 2017 at 11:07 AM, BartC <bc at freeuk.com> wrote:
>> Even when it turns out that the actual code on github is 1000 lines rather
>> than 500! Maybe it grew a bit since the 500 lines was quoted.
>
> I assume they're excluding blank lines, comments and docstrings. And I
> don't know whether the 500 lines is a hard limit or if there is a bit
> of leeway there.
>

https://github.com/nedbat/byterun/blob/master/byterun/pyvm2.py

github reports 869 sloc from a total of 1044 lines.

But 1000 lines is still small compared with the 220,000 lines of CPython 
(and that was an old version) which is only the C code and nothing else.

If someone wants to experiment with the behaviour of a byte-code, they 
might be able to do with this project (I haven't tried), more easily 
than with the real thing.


-- 
Bartc


More information about the Python-list mailing list