[Python-Dev] Python VM

Thomas Lee tom at vector-seven.com
Tue Jul 22 02:28:08 CEST 2008


Martin v. Löwis wrote:
> Jakob,
>
> This looks fairly correct. A few comments below.
>
>   
>> Control Flow
>> ============
>> The calling sequence is:
>> main() (in python.c) -> Py_Main() (main.c) -> PyRun_FooFlags() (pythonrun.c) ->
>> run_bar() (pythonrun.c) -> PyEval_EvalCode() (ceval.c) -> PyEval_EvalCodeEx()
>> (ceval.c) -> PyEval_EvalFrameEx() (ceval.c).
>>     
>
> What this misses is the compiler stuff, i.e. PyParser_ASTFromFoo and
> PyAST_Compile, which precedes the call to PyEval_ (atleast, no byte code
> file is available).
>
>   
Further, if I have my way with the AST optimization code, the symtable 
construction will be an explicit step in between these >:)

In any case, this is awesome work Jakob. It'd be great for this stuff to 
be documented in such detail -- I sure wish I had something like this to 
go by when I first started hacking on the source -- but the details seem 
to change quite often. Still, seeing the detail distilled once in a 
while is sort of nice, and great for anybody looking to get their teeth 
into the code.

Thanks for doing the hard yards. :)

Cheers,
T



More information about the Python-Dev mailing list