[pypy-dev] Work plan for PyPy

Maciek Fijalkowski fijal at genesilico.pl
Sat Jun 16 22:37:16 CEST 2007


Armin Rigo wrote:
> 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.
>
>   
Just a sidenote - rffi supports (and uses) macros. Not sure how this 
will look like in a ctypes-based solution.

Cheers,
fijal




More information about the Pypy-dev mailing list