Subject: Re: CCL:FORTRAN versus C

From: [email-masked] (Ron Shepard)
Date: Thu, 10 Feb 94 12:28:18 CST

Scott Presnell ([email-masked]) writes:

>There are indeed differences between Fortran and C specs (such as call by
>reference vs. call by value), but I'm not aware of differences that would
>allow for "better performance" given the above constraints...  Can you give
>us some more detail on what your compiler friends are referring to?

These are well known issues, and this chemistry mail exploader is not the
best place to discuss them.  Although fortran and C are quite similar in
many respects, there are some important semantic differences.  One of the
biggest that relates to performance is aliasing of variables.  The C
model is basically (with a few exceptions) that any two pointers can
point anywhere in memory; this prevents the compiler from making
assumptions about prefetching items into registers, setting up tight
pipelined loops, etc.  In fortran, there are not explicit pointers, only
implicit pointers to dummy arguments.  But fortran does not allow dummy
arguments that are modified to be aliased.  This allows the fortran
compiler to perform optimizations that a C compiler cannot.  On the other
hand, compact C code can exploit such aliases to do clever things.
Consequently, both languages have evolved into incompatible "local
minima" of sorts, where each has an advantage in different situations.
It is unlikely that fortran will change to adopt a "wild pointer"
semantics, and it is unlikely that C will tame its pointers (there was a
failed effort to do so during the ANSI standardization process).

$.02 -Ron Shepard