Byte code descriptions somewhere?

Cem Karan cfkaran2 at gmail.com
Sun Oct 2 19:04:50 EDT 2016


On Oct 1, 2016, at 8:30 PM, Ned Batchelder <ned at nedbatchelder.com> wrote:

> On Saturday, October 1, 2016 at 7:48:09 PM UTC-4, Cem Karan wrote:
>> Cool, thank you!  Quick experimentation suggests that I don't need to worry about marking anything for garbage collection, correct?  The next question is, how do I create a stream of byte codes that can be interpreted by CPython directly?  I don't mean 'use the compile module', I mean writing my own byte array with bytes that CPython can directly interpret.
> 
> In Python 2, you use new.code: https://docs.python.org/2/library/new.html#new.code  It takes a bytestring of byte codes as one of its
> twelve (!) arguments.
> 
> Something that might help (indirectly) with understanding bytecode:
> byterun (https://github.com/nedbat/byterun) is a pure-Python implementation
> of a Python bytecode VM.
> 
> --Ned.

byterun seems like the perfect project to work through to understand things.  Thank you for pointing it out!

Thanks,
Cem Karan


More information about the Python-list mailing list