[Numpy-discussion] C++ Example
Charles R Harris
Tue Mar 6 18:56:47 CST 2012
On Tue, Mar 6, 2012 at 5:39 PM, Sturla Molden <email@example.com> wrote:
> Den 7. mars 2012 kl. 00:43 skrev Charles R Harris <
> > I don't see generics as the main selling point of C++ for Numpy. What I
> expect to be really useful is exception handling, smart pointers, and RIAA.
> And maybe some carefule uses of classes and inheritance. Having a standard
> inline keyword will be nice too. But I'm not a modern C++ guru, so I may
> have missed a lot of things.
> "RIAA is evil, RAII is not" ;-)
> Actually, Cython has all of those features too :-)
> I am not suggesting NumPy should use Cython in the core. However if it
> did, the main machinery would already be in the compiler (typed memory
> views) :-)
Oh, I'd *much* rather use C or C++ for writing C code ;) Cython is great
for hiding all the mess of interfacing to Python, but, no Python, no mess.
The idea is to layer Numpy so that the bottom layer is independent of
Python. So we will probably do our own memory management and such (ala the
refactor), and C++ will be helpful for such things.
I don't stress generics for such things as the loop code. The current
template code for that isn't beautiful, but it isn't hopelessly ugly
either. There may, note may, be a role for inheritance there. But in any
case, I don't see the C++ transition happening over night, so there will be
plenty of time for long, testy threads along the way to keep us all happily
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion