[pypy-dev] Dynamic compilation via pyrex?

holger krekel hpk at trillke.net
Sun Mar 13 07:24:22 CET 2005


Hi Grant, 

On Sat, Mar 12, 2005 at 17:01 -0500, Grant Olson wrote:
> I'm working on a dynamic x86 assembler for python.

I noticed your pyasm announcements with interest already :- ) 

> Someone on comp.lang.python mentioned that you guys were
> dynamically compiling python code via pyrex.  I was under
> the impression that this was static compilation.  Which one
> of us is right?

We use Pyrex to statically compile dynamically generated
source code. The compiled code is then imported into the
process that generated the code.  But surely, this still means
we are statically compiling things. 

However, these days the pyrex backend is more or less superceded by
direct generation of C code.  This is still static but allows us much
more control of the generated C structures.   

> I tried digging around your website some, but couldn't find any info.

Yeah, our translation and annotation documentation is worse than 
lacking ... also because it has been changing very much all the
time but we are getting to a more stable base it seems ... (crosses
three fingers) so there is no good excuse for the missing 
documentation anymore :-) 

> BTW, the interpreter is in much better shape than when I
> last checked it out (probably 18 months ago ;-) )

Hehe, thanks.  Btw, at the Pycon conference (or rather at the
sprint before the conference) next week we want to push PyPy
further to become a compliant Python implementation.  Because
we can run PyPy on top of CPython we can test compliancy
independently of generating a standalone version. 

But we also work actively in the translation and type inference 
area.  Carl-Friedrich Bolz has been working lately on an LLVM backend
( see http://llvm.cs.uiuc.edu/ ) and we definitely are looking for 
dynamic machine code backends for multiple platforms. 

Let me note that with 'dynamic' we usually mean even more dynamic 
than your pyasm, in that you could assemble and run inline fragments 
of machine code at runtime (for implementing e.g. Psyco in PyPy). 

cheers, 

    holger



More information about the Pypy-dev mailing list