[BangPypers] SWIG

Gora Mohanty gora at srijan.in
Mon Sep 14 20:55:19 CEST 2009

On Tue, 15 Sep 2009 00:04:01 +0530
bhaskar jain <bhaskar.jain2002 at gmail.com> wrote:
> Problem is that there was a bug and they have changed a few lines
> in one of the C files. So my question is - will just applying the
> patch and installing the library again, will i get a fresh good
> python binding or do i need to regenerate the wrapper_ *.c files
> using SWIG.

It depends on what was changed, but it is best to regenerate
everything. Is this that much of a concern in terms of time,
etc. It is quite easy to set up a Makefile to do this.

> Any tips in working with SWIG, using the python bindings will be
> appreciated. Also is it a frequent problem of segmentation faults
> using the python bindings of C programs which employ lot of
> pointers. Sorry, I am new to SWIG.
> Is it advisable to use SWIG at all?

I would enthusiastically advocate SWIG, but have had arguments with
people who take a different view, and whose opinions I respect. The
best counter-arguments I have heard is cleanness of the generated
code, and efficiency, but at least for a non-pedal-to-the-metal
coder like me, SWIG definitely does the job. So, I would say that
if you can take a look at the generated SWIG code, and think that
you can do better, please do that, and contribute your approach
back to SWIG.


More information about the BangPypers mailing list