Ratfor demonstrates that with modest effort it is possible to convert Fortran from a bad language into quite a good one. A preprocessor is clearly a useful way to extend or ameliorate the facilities of a base language.
When designing a language, it is important to concentrate on the essential requirement of providing the user with the best language possible for a given effort. One must avoid throwing in ``features'' _ things which the user may trivially construct within the existing framework.
One must also avoid getting sidetracked on irrelevancies. For instance it seems pointless for Ratfor to prepare a neatly formatted listing of either its input or its output. The user is presumably capable of the self-discipline required to prepare neat input that reflects his thoughts. It is much more important that the language provide free-form input so he can format it neatly. No one should read the output anyway except in the most dire circumstances.
C. A. R. Hoare once said that ``One thing [the language designer] should not do is to include untried ideas of his own.'' Ratfor follows this precept very closely _ everything in it has been stolen from someone else. Most of the control flow structures are taken directly from the language C[4] developed by Dennis Ritchie; the comment and continuation conventions are adapted from Altran[10].
I am grateful to Stuart Feldman, whose patient simulation of an innocent user during the early days of Ratfor led to several design improvements and the eradication of bugs. He also translated the C parse-tables and YACC parser into Fortran for the first Ratfor version of Ratfor.
Beware _ local customs vary. Check with a native before going into the jungle.
The program ratfor is the basic translator; it takes either a list of file names or the standard input and writes Fortran on the standard output. Options include -6x, which uses x as a continuation character in column 6 (UNIX uses & in column 1), and -C, which causes Ratfor comments to be copied into the generated Fortran.
The program rc provides an interface to the ratfor command which is much the same as cc. Thus
The program ./ratfor is the bare translator, and is identical to the UNIX version, except that the continuation convention is & in column 6. Thus
./rc provides much the same services as rc (within the limitations of GCOS), regrettably with a somewhat different syntax. Options recognized by ./rc include
Ratfor exists on various other systems; check with the author for specifics.