[pypy-dev] sprints goals / restricted python?

Samuele Pedroni pedronis at bluewin.ch
Tue Jun 17 17:31:48 CEST 2003


At 14:39 17.06.2003 +0200, holger krekel wrote:
>Hello pypy and hello Armin :-)
>
>ASFAIK your idea of restricted python is to implement a
>TranslationObjSpace which emits C-code. We would e.g.
>run the interpreter (by running e.g. tests) against
>StdObjSpace and use the TranslationObjSpace to generate
>a C-file which is - when compiled and run - our restricted
>interpreter which can execute bytecode.
>
>I don't know but i think going the TranslationObjSpace way
>might turn into complicated code. For example how do you
>"detect" a loop from an objectspace's POV? It just sees
>a series of a series of ObjSpace-Method accesses and it seems hard
>to reverse engineer the loop. (I guess you say this loop-unfolding
>is basically a space/time trade-off :-)
>
>please correct me, if/where i am wrong.

you can use some kind of ObjSpace to do abstract interpretation,
but you can't simply use all the normal interpreter mechanism.

You either start from the AST and there loops and control flow are clear, 
or from the bytecode
and use it as it is as flow graph, each bytecode is a node and there are 
edges from
each bytecode to its successors in case of execution, or reduce it to basic 
blocks etc...

regards. 



More information about the Pypy-dev mailing list