[net.lang] FORTRAN/C and numerical programming

eugene@ames-lm.UUCP (Eugene Miya) (06/20/84)

Interesting discussion on physicists programming C and other things.

Background: started with FORTRAN {eventually learned Pascal and C (latter
is current preference) and Ada}.  Currently programming on a Cray XMP
in FORTRAN.

I have principally used UNIX and other systems in scientific applications
environments: image processing, simulation, and analysis.  Personally,
I think C is a better scientific language in many respects than FORTRAN.
The complaints of all double precision being too slow fall on deaf ears
here.  We need the precision.  When I worked at JPL, there existed a
math group to get as many bits difference out of a 36 bit Univac word
compared to a 32 bit IBM word (don't ask me why they didn't have a CDC,
they could not afford a Cray).  The loss of ** was not great-> pwr()
and other means were preceived as safer and more efficient.  What do you want,
execution speed or Voyager I missing Saturn after a billion mile trip
(by a couple million miles).

FORTRAN is probably here to stay.  Its modifability is reaching its end.
Vectorization and multiple processes [parallelism] are added grudgingly.
But, I would seriously doubt it would die.  I have attended X3J3 [ANSI FORTRAN]
meetings (and am a former member of X3J9 [Pascal standards]).  You have to
understand that huge (multi million line codes) were written in the 50s.
These still need to run.  Lots of industries still depend [Can you image
a system like BART switching as hardware gets obsolete?] on FORTRASH
[see two CACMs ago, a member of Huge Air Crash was pleading for 'the
whipping boy of the CS community.'  I think BTL's efforts for ratfor and
efl are an quite interesting way to transition over to languages like C.
Another thing I have started to notice is that the education of computer
use has spread from CS, math, and EE depts to physics, chem, art and
social science depts.  In general, the physics and chem depts teach
FORTRAN, the rest teach BASIC.  FORTRAN is out of the hands of CS.

What interests a lot of the old FORTRAN is the tools environment in UNIX.
Brenda Baker's struct program, and other HLL->HLL translators interest
a lot of people.  To get some easy (but understandability crude)
translator would help a lot of people out of the FORTRAN rut.

Oh, adding this, APL:  early implementations [inefficient] of APL killed
that language for many users.  I hear stories of row and rows of APL
programmers back East in IBM.  While APL was to have been a noble attempt,
it is rarely traught in physics depts.  Now, a system like UNIX which has
APL, LISP, C and f77 under one roof at least gives people a chance to
try new languages where may not be available on MVS or VMS.  One office
mate is just giving LISP a first try.  Perhaps, APL will get a second wind.
***Here's the meat******
Lastly, no flame, I just received a copy of the User's Guide to C under COS.
COS is the Cray Operating System.  We are eagerly awaiting the Cray C
compiler from Bell.  We know it is not a fine tuned compiler, but our
systems people prefer C over BLISS, and would love to have C on the XMP.

I have only really run C extensively on PDP,VAX,68K environemnts.
I have heard stories that on IBM C, there are some interesting architectural
side effects.  Briefly: C on the Cray: shorts are 24 bits, as are pointers.
The sizeof macro has no meaning in this context.
Longs and ints are 64 bits.  It has the enum and void types as well as
structure passing.  Floats and doubles are both 64 bits (too bad), but
the Cyber 180 also did this.  There are lots of fast registers as well
as a register float type.  A few additional functions are added for vector
copy operations.  I really wonder what C on a Univac environment is like.

Does any one have an Ada compiler for the Cray?  Need I say more?

In summary, FORTRAN is here to stay [too bad in some ways].  C (because of
the pcc and pcc-2) has a good chance of making its way into scientific
computing.  Pascal lesser so.  APL needs a second coming.

--eugene miya
  NASA Ames Res. Ctr.
  {hplabs,hao,research,dual}!ames-lm!statvax!eugene

malcolm@ecn-ee.UUCP (06/22/84)

#R:ames-lm:-34800:ecn-ee:15000001:000:616
ecn-ee!malcolm    Jun 21 19:59:00 1984

The best reason to use C instead of Fortran is the human interface.  For my
research I write large/long running number crunchers and an awful lot of the
code is used to parse the command line arguments and check their sanity.

True, C has some shortcomings (no complex!) but I'd much rather have the
nice string and structure manipulation.

Right now I am anxiously waiting for C++ to see the light of day.....

						Malcolm Slaney
						Nouveau Image Processing Lab
						Purdue EE Dept.
P.S.  Kuo Chen Li, here at Purdue, has defined and implemented a Vector C for
the Cyber 205.  It is real nice...and fast too.

steven@mcvax.UUCP (Steven Pemberton) (07/03/84)

> True, C has some shortcomings (no complex!) but I'd much rather have the
> nice string and structure manipulation.

C's string manipulation NICE???? Save me from languages with nasty
string manipulation!

Steven Pemberton, CWI, Amsterdam. steven@mcvax