Should I convert FORTRAN code to C?

Eugene N. Miya eugene at pioneer.arpa
Thu Jun 9 06:26:21 AEST 1988


I have been asked to post this.  Please send mail to him, not me.
Thanks.

--eugene

============mesg start===============

Some flames for thought ...

I agree that Fortran is a somewhat primitive language and that a
better language for scientific programming would be nice.  I see two
issues in making transition to something better.  The first is the
choosing of a suitable replacement language.  The second is that of
translating Fortran Dusty Decks.


1.  Choice of Language

I do lots of programming in both C and Fortran.  I think C is not the
answer.  It's too low level.  Multidimensioned arrays in C are hard to
implement well and in a way that will be portable.  One person's idea
of how to implement multidimesioned arrays will differ from another's.
Now try to write code that will handle both!  YECH!

Fortran 8X is not the answer.  It's a "dirty" language (to put it
mildly).  This is my personal debatable opinion.  The approch by the
committee here seems to be "let's add stuff we think is neat and hope
over the next 20 years that people decide on their own that they
shouldn't use things like COMMON, EQUIVALENCE, and column oriented
format." I don't see much chance of success in this approach.

OK, How about Ada?  I am _very_ new to this language but it seems to
be able to handle much of what one might desire for scientific
programming.  Code writtin in Ada has a good chance of being portable.
The problem with this language seems to be its complexity.  It won't
run nicely on a small (PC class) machine.  I wonder whether a possible
solution to this problem is to define a sublanguage of Ada for
scientific computation.  That is, maybe some features could be removed
to make the language run on small machines and still be nice for
scientific computation.  Will removing the task handling and exception
handling fix the complexity problem?


2.  Tranlation

What are the problem areas of tranlation of Fortran into other (more
sane) languages (e.g., C, pascal, Ada)?  A few problem areas I see are

	a.  multidimensioned arrays.  Fortran code is _often_ optimized
	    to account for Fortran's columnwise storage of 2-D arrays.
	    Pascal (and Ada, I assume) store rowwise.

	b.  EQUIVALENCE

	c.  COMMON

Any more here?

Matt Wette
mwette%gauss at hub.ucsb.edu



More information about the Comp.lang.c mailing list