[Pyrex] Questions about your approach

Andreas Kostyrka andreas at kostyrka.org
Sat Apr 12 19:17:08 CEST 2008


Am Samstag, den 12.04.2008, 14:05 +1200 schrieb Greg Ewing:

> They're aimed at different problems, I think. Python2c seems
> to have been an attempt to compile pure Python code. Pyrex
> is for interfacing between Python and C, so it's competing
> more with the likes of SWIG and Boost Python. It happens
> to have much the same effect as python2c if you apply it to
> pure Python code, but that's pretty much accidental.
> 

Actually, it does compete with SWIG only "indirectly", or one could
probably say "design" level.

IMHO, compared to SWIG, Pyrex wrappers around C code have IMHO a
different felling:

-) SWIG bindings are mostly automatic bindings, you can provide type
conversion helpers, but that's it.
-) Pyrex bindings OTOH are manually written.

In effect this means that SWIG bindings often have a nonpythonic feeling
as they just provide access to the C API, and sometimes need a Python
layer on top to feel idomatic.

Pyrex bindings, are not forced to offer the same API, so can provide a
more pythonic experience.

Just my $0.02,

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20080412/1d1e4247/attachment.bin 


More information about the Pyrex mailing list