DIfferences among Languages for Number Crunching?

Walter Bright bright at Data-IO.COM
Tue Mar 6 05:15:07 AEST 1990


In article <9003021955.AA28774 at euler.Berkeley.EDU> ndeng at EULER.BERKELEY.EDU writes:
<I have a question about which language is the "best" for scientific 
<computation (read: number crunching), especially for execution speed.

I hate to say it, but Fortran is still the best for the following reasons:
1. It's been around the longest, so the floating point routines are
   very mature and reliable. Lots of people rely on this stability, so
   if an implementation is weak in this regard, it's quickly corrected.
   C is not as well used for number crunching, and so the libraries are
   less well developed and less used.
2. Fortran has built-in support for complex data. Yeah, I know, you can
   fake it in C++. But nothing matches the convenience of being able to
   say:
	z = a + b*i
   Hardwiring a type into the compiler produces better results than
   a user-defined type.
3. Fortran has variably-dimensioned arrays. Doing this in C is a bit
   klunky.
4. Fortran compilers tend to optimize better than C compilers, because
   a) they've been around longer and b) have less aliasing problems.

There's a group, the NCEG, trying to address these deficiencies in C.

(BTW, Fortran is a miserable language for doing about anything else!)



More information about the Comp.lang.c mailing list