VM Architecture.

Venkatesh Prasad Ranganath rvprasad at cis.ksu.edu
Sun Aug 11 18:59:53 CEST 2002


Phlip wrote:
> Venkatesh Prasad Ranganath wrote:
> 
> 
>>Hi,
>>
>>I am looking for documentation about Python VM architecture to
>>understand how does one compile python code to bytecode and how
>>does the vm assimilate it. I need to know this to check if a project is
>>feasible. I could find the set of byt code
>>instructions in the module index that comes in python documentation.
>>However, it uses some variables like co_names and stuff
>>which I dould not find the documentation for. May be I have overlooked.
>>If somebody knows of any documentation about how the
>>Python vm works, in terms of it's guts, can you please give a link to it?
> 
> 
> What kind of project could need these specs?
> 

Well, I am looking for libraries to represent python code in some 
intermediate representation in memory to perform static analyses. 
Although it is trivial to write a parser for python, it is necessary to 
address the issue of how would one handle the part of the system with no 
source code, but with byte codes.  I know dis module disassembles.  I 
also looked into decompyle which can decompile python bytecodes. 
However, none of these modules have an intermediate representation which 
can be used as input to other sort activities like static analysis.

So, I was wondering if there was any such framework which can be used to 
represent python bytecodes in memory like say Jimple from Sable group 
can be used to represent Java bytecodes. If so, I want to look into it. 
  If not, it would be an interesting task to build one such framework as 
the python community lacks one.

-- 

Venkatesh Prasad Ranganath,
Dept. Computing and Information Science,
Kansas State University, US.
web: http://www.cis.ksu.edu/~rvprasad




More information about the Python-list mailing list