Should I convert FORTRAN code to C?

Doug Gwyn gwyn at brl-smoke.ARPA
Thu Jun 9 10:55:18 AEST 1988


The original poster was wondering if he should convert Fortran code
to C.  My answer to that is, not if you can get an adequate Fortran
compiler for your system.  If you think it would be useful, there is
at least one automatic Fortran-to-C translator commercially available
(Fortrix).  If you plan to thoroughly revise your application (so that
it amounts to a rewrite), you would be better off designing the
replacement from scratch, and it might make sense to implement the
replacement in C if you're not going to be dependent on EISPACK, IMSL,
etc.

Fortran's single biggest problem is that it has shitty support for
data structures.  If this doesn't bother you, then by all means
continue to use Fortran.  I think by now everyone who is likely to
learn better techniques would have done so.

It happens that many of our more interesting applications are
primarily written in C, because Fortran is just too puny.  And we
do run them on our Crays as well as on small and medium sized
systems.  I find that with sufficient care, useful C code can be
even more portable than Fortran, more efficient, and more
maintainable.  Of course with insufficient care, horrible code
can be produced in ANY language.

Use whatever tool seems right for the job and that you are
comfortable using.



More information about the Comp.lang.c mailing list