(e-mail address removed) (Paul Schlyter) wrote in message
[ ... ]
Your view and my view are not contradicting one another other. Indeed
Fortran has little real advantage for most work, since most work isn't
heavy number crunching.
Even within heavy number crunching -- there may be (probably are) some
specific tasks for which Fortran provides real advantages but it seems
pretty clear to me that C++ can be competitive for quite a few number
crunching tasks. For a few interesting data points, consider:
Matrix multiplication with MTL:
http://www.osl.iu.edu/research/mtl/performance.php3
Variety of tasks with Blitz++:
http://www.oonumerics.org/blitz/benchmarks/
FFTs with FFFTW versus various other FFTs:
http://www.fftw.org/speed/
IMO, these support my original statement -- C and C++ can compete with
Fortran, even within Fortran's area of specialization. They doesn't
_always_ beat Fortran by any means, and on average may even be
slightly slower overall -- but I'm not even certain of that, and if
they do end up slower on average, I'm pretty sure it's by a fairly
small margin.
FFFTW probably shows up the best of these: almost every time it loses,
it's not to something written in Fortran; rather, it's to hand-tuned
assembly language code directly from a processor vendor -- and
sometimes it even beats those!
Unfortunately, there are few C99 implementations out there. Do
you know any C99 available for supercomputers, for instance?
Cray says their current C compiler conforms with C99 (the X1 is
probably the fastest "production" computer available).
HP claims that Compaq C 6.5 for AlphaServers conforms with C99.
I haven't been able to find anything from NEC or IBM saying whether
their compilers conform with C99 or not -- so it's probably reasonable
to guess at "not".
Glancing through the rest of the top 10 on the Top500 supercomputer
site, it looks like the majority are based on Intel or AMD chips that
have C99 compilers, though it's possible that these machines are
customized to the point that they need custom compilers and/or
libraries to achieve full functionality.
.... try the standard problem of writing a subroutine to invert a
matrix of arbitrary size.
I haven't seen a benchmark specifically related to this task alone,
but unless I'm mis-reading the annotations, it looks like the Blitz++
benchmarks include at least some matrix inversion, and it seems to be
quite competitive.
Fortran has had the ability to pass a
2-dimensional array of arbitrary size to subroutines for decades. In
C++ you cannot do that -- you'll have to play games with pointers to
acheive similar functionality. That's why I once wrote the amalloc()
function (it's written in C-89 but compilable in C++), freely
available at
http://www.snippets.org
There are quite a few matrix libraries in C++ that deal directly with
two- (and three-) dimensional matrices. Internally, they clearly have
to break this down to something simpler, but except on (unusual) array
processing machines that actually use 2-D or 3-D addressing, the same
is true with Fortran.
[ ... ]
I guess real programmers want real problems, or else they'll get
bored. Try to put a very skilled engineer on an accounting job
and you'll probably see similar results....
Perhaps so -- nonetheless, if you want accounting to get done, you
need to get somebody to do it. Trying to use tools that are only
usable by people who refuse to work on that problem rarely produces a
useful result.
In the end, I mostly agree -- just for example, I suppose there's a
comp.lang.cobol, but I'm pretty sure you won't find any posts from me
in there, and if you do, they're cross-posts from somewhere else. My
lack of interest, however, is hardly the final final word that it's
worthless!