[comp.lang.fortran] What is FORTRAN for?

grisanti@plains.NoDak.edu (Ames Grisanti) (07/26/90)

> Please, don't consider my question offending, but why the hell in this world
> you people still using FORTRAN, while so many nice C around.
> 
Because some people prefer not to RE-INVENT the wheel using C.

Many applicaions and subroutine libraries are available in FORTRAN
and some of us would rather USE the computer rather than spend large
amounts of time programming.

If I ran off re-writing every application I use in whatever new
or better language came along. I would never get any REAL work
done.

Ames Grisanti
[grisanti@plains.NoDak.edu      --         Internet]
[grisanti@plains or ndsuvax     --         Bitnet  ]
[uunet!plains!grisanti          --         UUCP    ]

worley@compass.COM (Dale Worley) (07/30/90)

In article <1990Jul25.174153.16896@ecn.purdue.edu> moshkovi@sanandreas.ecn.purdue.edu (Gennady Moshkovich) writes:
   [W]hy the hell in this world
   you people still using FORTRAN, while so many nice C around.

Having written a lot of software in both, I'm not going to compare why
people choose Fortran or C...  What I *do* wonder about is why anyone
uses either.  They are at the best, 1970s vintage, and both require
you to do a lot of work specifying details that are not genuinely
relevant to the algorithm.  It seems that the rate of advance of
programming technology is inherently much slower than the rate of
advance of hardware technology.

Sigh,

Dale Worley		Compass, Inc.			worley@compass.com
--
"Do what I say, not what I do" shall be the loophole of the law.

ndeng@EULER.BERKELEY.EDU (08/01/90)

O.K, here is my 2 cents worth:

I wrote a program of about 5K lines on a PC, mainly for matrix manipulation,
eigenvalue problems, tensor analysis, etc. After I debugged on the PC and
confident for some small scale problems, I ported the program on a bunch of 
big machines, a VAX 8800, an IBM 3090, and a Cray X-MP and run for BIG 
problems (if you know FEM, you will understand what 100,000 degree of freedom
mean --- A set of simultaneous equations of 100,000 variables).

I wrote the program in FORTRAN. I didn't have to change a SINGLE line to let
the program run from PC through Cray. I wonder if any other languages can
enjoy such a portability.

Of course, when I need to program for interactive graphics, etc., I go back to
C or Pascal, but for the CORE of the computations, I use FORTRAN.

I once heard people said that there are only 20% of code in a program are 
really useful in computation and they need 80% of effort. Other 80% of code
are really only for human interface (I/O, memory, graphics, etc.) or "cosmetic"
and they may need only 20% of effort. IMHO, FORTRAN is the language for the
20% of code.

rosenkra@convex1.convex.com (William Rosencranz) (08/02/90)

In article <9007312124.AA14917@euler.Berkeley.EDU> ndeng@EULER.BERKELEY.EDU writes:
>I wrote the program in FORTRAN. I didn't have to change a SINGLE line to let
>the program run from PC through Cray. I wonder if any other languages can
>enjoy such a portability.

good for you! that means you are a good programmer. is sez nothing about
the language, however.

i regularly do this with C (atari st, ibm pc, sun, dec 3100, sgi, alliant,
convex, cray x/y/2, etc). it is NOT the language. it is the PROGRAMER.

in fact, having to port codes from platform to platform for a living,
i find C (for me) easier to port (generally) than fortran. if i had f77
on my atari st, and an emacs with fortran mode on the st, i'd probably
use more fortran for code i also use at home. i find that there
are more places to abuse the language (abuse to me means writing non-
portable code :-) in fortran than C. with C, the problem is in library
compatibility more so than the language itself. things like enum in C
were not part of K&R so i don't use them. but hey, that's me. your
results may vary. C was designed to be portable. fortran was (originally)
designed to program in something other than assembly language. remember,
that was a LONG time ago. C was developed to make unix portable.

if your platform is unix, you really can't do much systems programing
in fortran, easily, at least. C is the real choice, rightly so. if you
only write applications which crunch, then fortran is, of course, an
excellent choice. i don't use pascal since it is no where as "universal"
as C, certainly not in supercomputer circles.

>I once heard people said that there are only 20% of code in a program are 
>really useful in computation and they need 80% of effort. Other 80% of code
>are really only for human interface (I/O, memory, graphics,etc.) or "cosmetic"
>and they may need only 20% of effort. IMHO, FORTRAN is the language for the
>20% of code.

no problem here...

the 80% of the code is really what sets apart good commercial code from
just a hack. that 80% makes or breaks an application (its commercial
success), especially on smaller systems (pc's [generic]). if your interface
doesn't turn people on, no matter how well crafted the "guts" are, you
die. unfortunately, those are the facts. i have a code on the market now
which includes things like FFTs. it is 60,000 lines of C of which about
50,000 lines deals with the user interface. it could not have been
written in fortran, at least not in "only" 60,000 lines. try writing an
X11 application all in fortran sometime. fortran is great for simple
arrays, but it is terrible for more complicated data structures where it
is desirable to group dissimilar data types together. you can't have
an array in fortran with both integers, floats, characters, etc. you
can use a struct in C, however, to do this.

this is a religious issue. it really should not be. use the best tool for
the job. use the best tool for you. patently dismissing a language as bad
for whatever reason is just not very wise, IMHO, especially a widely
used language (like C). there are well over 10 million pc's on the
planet and most of the code running on them was written in C (or
assembler). there are only (arguably) a few thousand supercomputers
with most of the code there in fortran. which would you call more
widely used? actually, you could argue that cobal (yeech!) is much
more widely used than fortran since much of the financial transactions
on the planet are done with code written in it. is cobal a poor
language? hardly. is fortran better? no, not for doing the job for
which cobal was meant.

what do you think about Ada? the DoD is just about mandating it for
embedded systems. it is more like pascal and C++ than fortran. the
reason ada was developed was not to do matrix multiplies, but to
be able to develop 1,000,000+ line applications and be able to
maintain them.

-bill
rosenkra%c1yankee@convex.com

(my opinions, not my employer's...)

Bill Rosenkranz            |UUCP: {uunet,texsun}!convex!c1yankee!rosenkra
Convex Computer Corp.      |ARPA: rosenkra%c1yankee@convex.com