[SciPy-dev] Inclusion of cython code in scipy

Gabriel Gellner ggellner@uoguelph...
Wed Apr 23 10:28:40 CDT 2008

I am confused by what Cython disappearing means. It is pure python, and
generates C code. Lets say it is no longer maintained, I can still build my
existing code using the last version and I am no worse off. For my code to
become useless python would also have to disappear (or change so dramatically
that I couldn't use my old codes). By this logic no core tool should be
written in python either? 

The code is open source it can't be taken away from me, it just might become
archaic, but that is no different from the current situation with g77, which
is still used extensively.

I agree that C++ is more portable, but are there examples of open tools
really disappearing?


On Wed, Apr 23, 2008 at 09:41:06AM -0500, Nathan Bell wrote:
> On Wed, Apr 23, 2008 at 8:00 AM, Ondrej Certik <ondrej@certik.cz> wrote:
> >
> >  Isn't this a similar (if not the same) problem when writing your code
> >  using SWIG?
> No, because the implementation (i.e. part that's harder to recreate)
> is still written in C++.
> >  Let's take sparsetools.i as an example, it also contains a lot of non
> >  python, non C code. So one needs to depend (and maintain!) SWIG. Well,
> >  Cython is a lot more lightweight and more robust solution imho.
> A lot?  I took numpy.i from the NumPy repository, made a few changes,
> and added sparsetools.i to generate the templates.  If SWIG
> disappeared overnight, I'd wrap *the very same, unmodified C++ code*
> using another wrapper generator (perhaps Cython).  If I wanted to use
> sparsetools in another VHLL then I would wrap it for that one too.
> OTOH if I had written sparsetools in Cython (as opposed to wrapping
> sparsetools with Cython) and Cython disappeared, then I'd have to
> rewrite the a substantial amount of the implementation.
> Again, I think using Cython in place of SWIG is a fine thing to do.  I
> just wouldn't want write too much of it any more than I'd want to
> write reams of hand-coded C wrappers or reams of SWIG.
> >  But even if Cython stays as yet another language -- it's still easier
> >  and less error prone than to write the C code by hand.
> I don't disagree.  However, writing C++ and wrapping with SWIG is also
> easier than writing hand-coded extension modules, with the added
> benefit of decoupling the core implementation from the interface.
> -- 
> Nathan Bell wnbell@gmail.com
> http://graphics.cs.uiuc.edu/~wnbell/
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev

More information about the Scipy-dev mailing list