Should I convert FORTRAN code to C?

J. Eaton chpf127 at ut-emx.UUCP
Fri Jun 17 22:20:52 AEST 1988


In article <224 at raunvis.UUCP>, kjartan at raunvis.UUCP (Kjartan Pierre Emilsson Jardedlisfraedi) writes:
> 
>  I personally made the change from FORTRAN to C one year ago, and today I
> do not regret it , though there came times when I wanted to do some really
> mean things to that stupid computer.

   I don't understand this idea of refusing to write code in more than 
   one language.  Why not write in whatever language is most convenient
   for the job at hand?  I use mostly Fortran because there are a lot
   of numercial libraries available that I simply don't care to rewrite
   or translate to another language.  However, I don't object to C or
   any other language (except BASIC :-) if it fits the requirements of
   the job...

>                                           I haven't  completely given up 
> FORTRAN though, as there are still many libraries in FORTRAN around here, but
> I simply build jacket routines for them (i.e routines which interface calling
> conventions of two different languages) with the JBL utility. In that way
> I don't have to write anything in FORTRAN but I still can use all the
> available FORTRAN subroutines. Knowing that FORTRAN calls everything by
> reference and C calls everything by value, it is easy to pass the arguments
> from the C program in such a way that the only interfacing you need to do is
> converting the pre-underscored C routine function name to the upper-case
> FORTRAN name.

   But I DO object to this.  At the present time, multilanguage programming
   is NOT a good idea.  AVOID it if at all possible.  It makes porting
   to new environments especially difficult, if not impossible in many
   cases.  Fortran may not be your favorite, and C isn't perfect either,
   but mixing the two is bound to cause trouble for you or someone else
   in the future.  The whole world is not VM/CMS, COS, NOS/VE, VMS, or
   even 4.3 BSD.  Moving a program which contains only Fortran or only
   C from any one of those environments to another is hard enough.
   Don't make it any more difficult by mixing in a load of interface
   routines which are system dependent!  This will make moving your
   code to new machines/operating systems such a pain in the ass that
   very few will even give it a second thought.

   Of course, if you really want your code to die with the machine it was
   written for, disregard the above.

> 	Say it in any language you like, but say it clearly!

   I still agree, just say it in one at a time.
 
> 			Kjartan Pierre Emilsson, Iceland.


   J. Eaton
   UT Dept of Chemical Engineering

   And old machines really do die.  Just ask any old CDC 6600.  What?
   You're still using one?  Oh.  Sorry.  Maybe machines ARE forever.



More information about the Comp.lang.c mailing list