[SciPy-dev] Boost vs CXX and SCXX

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Fri Sep 13 22:52:42 EDT 2002


>>>>> "EJ" == eric jones <eric at enthought.com> writes:

    EJ> Hey Mark, Like you, I'd pick boost or SWIG (which has made
    EJ> *huge* leaps in the last year for C++ stuff) for wrapping a
    EJ> C++ library.  But that isn't what we're choosing here.  Weave

This is totally OT but I just took a look at SWIG
(http://www.swig.org) again and yes it has made *huge* improvements
since I used it last.  AFAIK, the only big features that BPL has over
it is that BPL allows one to implement "virtual methods in the target
language", i.e. you can derive a class from a wrapped C++ class in
Python and expect the wrapped library to be able to call your Python
subclass.  Also, as mentioned in SWIG's features page the trouble with
nested classes.

However given the current state of features almost everything else is
supported very nicely.  AFAIK, this should do for *many* situations.

The nice things about SWIG are:

  1. Its so easy to wrap thanks to SWIG's parser/compiler.  This is
  something that BPL does not have.  It is incredibly easy to wrap a
  library without having to learn another C++ API.

  2. Documentation.

  3. Ease of use for the truly lazy. :)

Actually the SWIG features page talks about all this in better detail
than I've done here.

I also noticed that the SWIG folks are unhappy about lots of the
negative publicity they got way back (including some silly comments
from me) due to lack of various features.  This is understandable.

This is not a comparison between SWIG and BPL.  BPL is very cool too
and is developed almost single handedly by David who is an amazing
programmer.  SWIG has been around for *very* long and has many more
developers.  Its nice to know that SWIG is still under active
development and that it has had enough steam to get to where it is. :)

I think SWIG has a great future.  Better still it looks like
C/C++->Python interfacing has a great future with all these new
wrapper generation tools and with Pearu's f2py Fortran->Python also
has a great future.  Its a huge win for Python. :)

Thanks Eric for pointing this out.  

cheers,
prabhu



More information about the SciPy-Dev mailing list