On Sat, May 17, 2008 at 6:42 PM, Dag Sverre Seljebotn
<[EMAIL PROTECTED]> wrote:
>
> Cython is a different approach from SWIG (see
> http://wiki.cython.org/WrappingCorCpp; in particular SWIG uses more layers
> of indirection).
>

>From the link:
"[SWIG] Can wrap almost any C and C++ code, including templates etc.
Disadvantage is that it produces a C file, this compiles to .so, but
then it also produces a Python wrapper on top of this .so file. So
it's messy and it's slow. Also SWIG is not only targeting Python, but
other languages as well."

I really wish that people didn't spread FUD about SWIG.  For
reference, here's the "messy and slow" Python wrapper for a function
in scipy.sparse:

52      def expandptr(*args):
53          """expandptr(int n_row, int Ap, int Bi)"""
54          return _csr.expandptr(*args)

From:  
http://projects.scipy.org/scipy/scipy/browser/trunk/scipy/sparse/sparsetools/csr.py#L52

I understand that scipy.sparse does not use all features of SWIG
(which may produce uglier wrappers), but I think the above case is a
fair example of what to expect when wrapping typical C/C++ libraries.

More disingenuous FUD here: http://www.sagemath.org/doc/html/prog/node36.html

-- 
Nathan Bell [EMAIL PROTECTED]
http://graphics.cs.uiuc.edu/~wnbell/
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to