C vs. FORTRAN

Gregory Kemnitz kemnitz at mitisft.Convergent.COM
Fri Aug 4 16:30:32 AEST 1989


In article <3288 at ohstpy.mps.ohio-state.edu> SMITHJ at ohstpy.mps.ohio-state.edu writes:
>This may have been discussed here millions of times before, but here it goes.

It has :-)

>
>What are the reasons for using FORTRAN over C?
>

Compatibility with or upgrades to existing software, which is likely to be
huge, unwieldy, and politically entrenched (ie it is difficult/impossible
to convince management that it should be re-written).  Also, FORTRAN compilers
on Crays are better (generate faster, more vectorized code) than the C
compilers.

>I have heard claims that the code is easier to optimize and that current
>benchmarks show that this is the case on all mainframes.  My experience is
>that this is pure bu****it.

I suspect that on (scalar) mainframes the "ease of optimization" is, as you
mention below, due more to the relative maturity of FORTRAN compilers on these
platforms than to any inherent advantages of the language.  Many mainframe
vendors originally just ported PCC to their machines and shipped it as "their" C
compiler.  This situation, however, is improving with time (and UNIX).

> Having done my own testing, I find that C runs
>faster on PC's.

This is true.  There is a much larger market for good C compilers on
PC's than there is for FORTRAN compilers, since many big FORTRAN programs
solve problems that would choke PC's in any language no matter how well
compiled, and small FORTRAN programs are often easier to rewrite in C
than to port to PC's in FORTRAN.

>
>Is it likely that C runs slower--on say the VAX--because it is only in
>version 2.4 whereas the FORTRAN compiler is at version 90+ (i.e. fewer
>man hours have been put into developing mainframe C compilers)?
>

(See above)

About the VAX, however:

The VAX (running VMS) was for many years the machine of choice in industry for
developing software in FORTRAN.  The software development environment in VMS
is built around FORTRAN, much as UNIX is built around C.  The programming
style used for VMS shell scripts is quite familiar to the FORTRAN programmer.

The VAX extensions to FORTRAN made it an (almost) acceptable language - while
making VAX FORTRAN quite unportable :-)  The VAX is popular enough that many
newer FORTRAN compilers understand most VAX extensions, however.

>No remarks about the ease of use of complex numbers in FORTRAN are acceptable.

I can hear the flamethrowers firing up now...

Disclaimer:  :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-)

>-- 
>/* Jeffery G. Smith, BS-RHIT (AKA Doc. Insomnia, WMHD-FM)       *
> *    The Ohio State University, Graduate Physics Program       *
> *        3193 Smith Lab, Columbus, OH 43210  (614) 292-5321    *
> *    smithj at ohstpy.mps.ohio-state.edu                          */

----------------------------------+--------------------------------------
Greg Kemnitz                      | Software without hardware is an idea.
kemnitz at Convergent.COM            | Hardware without software is a space heater.
soon:				  |
kemnitz at postgres.berkeley.edu     | --Unknown author



More information about the Comp.lang.c mailing list