What are the differences between SWIG and Boost.Python?

Bryan belred1 at yahoo.com
Sun Apr 6 11:39:35 EDT 2003


mike,

you mentioned small c libs you use pyrex.  what about small but complex data
types?  we have a structures that contain pointers to structures that
contain pointers to structures. etc.  some structures contain methods, some
data, some with many constants.  imagine a simplified c++ written in c.
everytime we want to write an extension, we always seem to just write it in
c instead of pyrex so we can simply bring in the headers as is.  in pyrex,
don't you have to redefine all the structures?  if pyrex had something like

extern "pyrex"
   #include "my_complicated_c_structures.h"

it would be great.  i haven't dived into pyrex all that much and i know it's
an incredible project, but redefining this header stuff just keeps me away
from it.

bryan

"Mike Rovner" <mike at bindkey.com> wrote in message
news:mailman.1049495109.20211.python-list at python.org...
> FWIW, I decided for myself:
>
> - wrap small C libs with Pyrex,
> - wrap big C libs with SWIG,
> - wrap small C++ libs with boost.python,
> - wrap big C++ with (I still have to do that ;)
>
> Mike
>
> PS.
> For me small is tens, big is hundreds and more
>
> "sdieselil" <sdieselil at yahoo.com> wrote in message
> news:169a7283.0304040821.9ad0976 at posting.google.com...
> > Hi
> >
> > I want to write C extension for Python. I know that there are 2 most
> > popular libraris for this purpose: SWIG and Boost.Python. What are the
> > differences between them? Which one is better for little extensions
> > and which is better for large-scale extensions?
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
>
>
>






More information about the Python-list mailing list