What's your first choice if you have to write a C module for python?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Tue Aug 26 08:56:43 EDT 2008


newpt... at gmail.com:
> I read this interesting post comparing Boost.Python with Pyd:
> http://pyd.dsource.org/vsboost.html
> What's your opinion about it?
> What's your first choice when you have write a C/C++ module for Python?

That's not exactly a post.
Pyd works well enough, it's easy to use and requires very little extra
code for the interface, I've used it several times. But it's designed
for D, not for C/C++, so in some situations it can be useless. For C/C+
+ you can find any kind of lib to wrap with Swig/ SIP/ Boost Python/
Cython/ etc, but you can't find much for D yet. And the D community is
very small, so there's just 1 person that updates Pyd, so updates are
slow, support limited (but it exists, on the #D IRC channel) and so
on. D surely isn't as complex as C++, and it's way nicer, but it's not
simple either, so learning it may require some time. Another thing to
think about is that C code sometimes may be even two times faster than
D code, so if max speed is essential, then D may not be the best
choice.

Bye,
bearophile



More information about the Python-list mailing list