Drew McCormack wrote:
> The problem I always have with these "Here is a story about how
> inefficient C is, and how wonderful Fortran is"-type stories is that
> they seem to ignore the overwhelming success of C. Sure there will be
> cases where, for whatever reason, it has led to disaster. But my guess
> is that you are writing your email on a Windows, Linux or Mac, the OSes
> of which are all written in C. And an OS is not a trivial piece of
> software. Could someone have written MSOffice in Fortran? Maybe, maybe
> not. I think you can write bad code in any language, God knows I've
> seen enough bad Fortran.
Drew correctly points out that C has been very successful, especially as
a language for writing operating systems. This should not be a
surprise. C was designed to be an OS implementation language. In OS
code you need to directly manhandle memory addresses. C is designed for
this task. However, it is not necessarily the case that a good OS
implementation language is also ideal for writing scientific code that
runs efficiently, which, if I recall, was the original inquiry. Indeed,
C's pointer centric design, which is so well suited for system software,
is also the root of its optimization problems. Fortran, on the other
hand, was designed for scientific programming, and for enabling the
generation of efficient code. It makes sense to use languages for their
intended purposes.
Cheers,
Bill
--
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
|