Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: David Cournapeau <david <at> ar.media.kyoto-u.ac.jp>
Subject: Re: rewriting in C (was ANN: Masked Array...)
Newsgroups: gmane.comp.python.numeric.general
Date: Sunday 21st January 2007 06:04:30 UTC (over 10 years ago)
Russell E. Owen wrote:
>
> I'm curious why the low level stuff is in C instead of C++? I would have 
> thought that C++ templates and possibly even the standard template 
> library would be a huge win for coding array-type classes.
I don't know the specifics for numpy, but C++ has huge problems compared 
to C for code which is meant to be used by other languages: C++ has no 
ABI standard, loading C++ classes dynamically through dlopen mechanisms 
is difficult (it basically means rewriting a C api over C++, AFAIK). 
Also, template are extremely difficult to use in a sensible way, and 
many advanced tricks using templates are not well supported by often 
used compilers (looking at boost sources for compiler specific 
workaround would give you an idea); in numeric codes, template are 
useful to have one implementation for all the C type availble (float, 
double, int, etc...), but those are cases which can easily be generated 
by code generator tools (like autogen; numpy is using its own).

There are cases where C++ is useful compared to C++; I don't think numpy 
is one of them,

David
 
CD: 3ms