Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Yes, weave is unmaintained, ugly, and hard to debug >

What is this bad mouthing of scipy.weave? I am a big fan of this approach. Nympy for everything + a simple weave inline for the inner most loop.

Maybe it is not maintained simply because it works?



Though I love weave myself, it does not get much love in the numpy community. There you would be discouraged from using weave and strongly nudged towards Cython.

The weave source hasnt seen development since ages, whereas Blitz++, the C++ array library that it is based upon has moved on quite a bit. Blitz++ has added SIMD support, or rather restructured its code so that the compilers find it easy to vectorize. The new version of Blitz++ holds its own against ifortran in terms of vectorization. These are some of the advantages that you could have enjoyed had weave been kept uptodate. I dont blame the numpy community for this though, though Blitz++ sees continuous development there has not been any formal release in tens of years. So it does become difficult to incorporate such a library. But I dont think that is the main reason why weave has languished.

I am sure Cython is great, but what I like about weave is the syntactic sugar that it brings. I do not have to write raw loops or do pointer arithmetic. If you want this kind of syntactic sugar in Cython now, you call back into the numpy API. If the default API does not give you the speed that you want, you have to expose the raw pointers of the arrays and to the messy pointer arithmetic and operations yourself. Nothing wrong with that, just that it can be error prone.

Cython however has other good things going for it, for instance it allows easy coordination with OpenMP, so it is easy to parallelize array updates, without incurring the multiple processes overhead.


I actually love weave but I felt it was irresponsible to advertise its use without a huge warning.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: