From: Thomas Fricke (fricke@ikki.informatik.rwth-aachen.de)
Date: 06/30/93


From: fricke@ikki.informatik.rwth-aachen.de (Thomas Fricke)
Subject: Fortran, f2c and so on...
Date: 30 Jun 1993 17:43:44 GMT

There are several questions about FORTRAN and Linux.

1. Is there any Compiler?
   The answer is NO, but there is a fortran-to-C converter (f2c),
   which allows to translate STANDARD F77 into K&R C, Ansi C or C++
   (optional).
   It is a PD distribution made by Bell-Labs force the migration AWAY
   from fortran. If you have clean standard sources, it is a very fine
   program to translate numerical libraries into the world of C.

2. Where can I get f2c?
   Ask archie for your local ftp server!

3. Why is the code slow?
   Because of the fortran convention every value is represented by
   its address, and every procedural parameter, even const int is
   replaced by a pointer. Look into the C code of a short F program,
   and you see a lot of possibilities to improve the code by hand!
   It is left to you, to decide, if it is worth while to make these
   optimizations by hand.

4. Is it a good idea to use f2c?
   Generally, it is a good idea to use f2c to translate clean and
   regular F sources to C. If you have some programs using a lot
   of machine specific extensions, OR if you cannot catch the the
   author of the spaghetti code, OR it uses some kinds exceptions
   as the regular way to leave a subroutine (the worsest thing
   to make even object oriented languages to a spaghetti machine)
   DO NOT EVEN THINK ABOUT IT! F2c is useful as a migration tool,
   not as the regular part of a fc.

Thomas Fricke (thomas@acds16.physik.rwth-aachen.de)