[pypy-dev] Work plan for PyPy

Armin Rigo arigo at tunes.org
Sat Jun 16 19:10:54 CEST 2007


Hi Simon,

(This is also a follow-up on concerns raised by Christian on #pypy
today)

On Fri, Jun 15, 2007 at 05:44:54PM -0700, Simon Burton wrote:
> I hope we can do all this with rffi, but there are two really
> cool things about rctypes:
> 1) it runs on cpython (our main app takes 30minutes+ to compile)
> 2) it has an automatic code generator (ctypes can autogenerate
> python wrappers from C header files)

For 1), this would actually be possible with rffi too.  The trick would
be to have two implementations of the lltypesystem objects (array,
structures, etc.).  The existing implementation would only be used when
ctypes is not available; if ctypes can be imported, then the other
implementation could systematically be used.  With a bit of effort it
could have a fully compatible interface, but be internally implemented
as ctypes objects (e.g. lltype.malloc(S) would build a ctypes structure
type corresponding to S, and internally instantiate that).  Then we
could really call rffi functions, by turning it internally into a ctypes
function and calling it with the ctypes objects underlying the passed-in
arguments.

This might even not be completely insane - in my opinion, less than
implementing and maintaining rctypes itself.  It's also something that
can be done by someone not deeply into the code base, as long as he
knows the lltype interface and how to use ctypes.


A bientot,

Armin.



More information about the Pypy-dev mailing list