[Pyrex] Pyrex versus SWIG - a testimonial

David McNab david at rebirthing.co.nz
Fri Sep 14 10:20:55 CEST 2007


Hi,

Well, I've just released 2 implementations of wrappers solving the same
problem, one in SWIG and the other in Pyrex.

Each one is a python wrapper to the mjpegtools 'yuv4mpeg' YUV stream
processing interface.

SWIG version - www.freenet.org.nz/pyyuv4mpeg
Pyrex version - www.freenet.org.nz/y4m

I did the SWIG version first. The number of kludges I had to make to get
the SWIG version working reasonably well resulted in a bit of a mess
with my files, particularly with the interface portion of the .i file.

Even after much tinkering, I'm not happy with the speed, or the
interface. The whole thing took me several days on and off.

Then, came the Pyrex version. I only started writing it last night, so
in less than a day, I've got it to a release point. Far less effort, and
I've ended up with a much more Pythonic interface that I'm much happier
with. And, it's way easier and more intuitive to use.

The price of this more graceful Pyrex-based wrapper is having to
copy/paste big chunks of code from C header files and reformat it to
Pyrex syntax.

But after this experience, I can see it's a very small price indeed.

So, thanks again to Greg and the Pyrex community! :)

Cheers
David






More information about the Pyrex mailing list