Fortran vs. C for numerical work (SUMMARY)
Doug Gwyn
gwyn at smoke.brl.mil
Wed Dec 5 08:00:34 AEST 1990
In article <184a59d8.ARN0ebd at pilhuhn.uucp> hwr%pilhuhn at bagsend.ka.sub.org writes:
>But did someone see a self vectorizing compiler for C as there are many
>for Fortran ?????
There are vectorizing C compilers, particularly on large machines, but
if you're interested in comparisons you need to appreciate that Fortran
has essentially only one form of data structuring, the array, while in
C arrays are much less commonly used, other more appropriate data
structures taking their place. Thus, while vectorization is important
for many Fortran applications, the same optimization is of much less
importance in C. There are numerous other forms of optimization that
can be (and often are) applied in the course of generating code from C
programs. As others have mentioned, the semantics of pointers raises
more severe aliasing concerns than apply to Fortran, so in some cases
C code must be less highly optimized than corresponding Fortran code.
This is traded off against more freedom for the C programmer, since it
is the Fortran programmer's responsibility to not alias function
arguments whereas C permits aliasing (which can at times be very useful).
Anyway, discussions about code optimization should have little to do
with selection of a programming language.
More information about the Comp.lang.c
mailing list