Python ByteCode and Virtual Machine documentation

Lucio Torre lucio at movilogic.com
Thu Oct 25 21:12:43 EDT 2001


Terry Reedy wrote:

>"Lucio Torre" <lucio at movilogic.com> wrote in message
>news:mailman.1004049566.23516.python-list at python.org...
>
>>Ive seen someone comment on the bytecode translation of some pieces
>>
>of
>
>>code, but never seen any documentation.  So i have two questions:
>>
>>a) where can i find documentation of the virtual machine of python?
>>(suppose i want to implement Thyton, a TCP parasitic computing
>>
>version
>
>>of python)
>>
>
>Try the 'dis' (disassemble) library module
>
>>b) is messing with the virtual machine a 'bad thing'?
>>
>
>For most of us, probably yes.  But for fun, search google for
>'bytecodehacks' (its non-library module that enables you to hack byte
>codes).
>
>>i mean, for
>>example, that the VM is not defined because thats implementation
>>dependant and i should only care about understanding and parsing the
>>code? if its so, why?
>>
>
>The VM currently used by the standard C implementation is intentially
>and explicitly *not* part of the language specification.  (The Jython
>implementation, for instance, compiles Python to Java byte codes
>instead.)  It is an implementation device whose details can (and do)
>change from release to release.  If someone were to develope a
>completely different but substantially better VM, GvR would feel free
>to adopt that instead.
>
>Terry J. Reedy
>
>
>

Thank you very much for the info. I missed the dis module. So i think 
its time to share my impression: the search function from the python 
site does not perform their function very well. theres a page named: 
17.10.1 Python Byte Code Instructions, and the file name is 
:http://python.org/doc/current/lib/bytecodes.html and neither bytecode, 
bytecodes, byte code or byte codes make that page show up.

or maybe they show up and this time i missed it. but google is pretty 
good at helping me find things, and im having problems with the search 
at python. it may be me, and if its so, could someone enlighten me, please?

thanks for the info on the VM, dis and bytecodehacks!

lucio








More information about the Python-list mailing list