Ratfor
Developer | Brian Kernighan |
---|---|
First appeared | 1976 |
Website | sepwww.stanford.edu |
Influenced by | |
Fortran, C |
Ratfor (short for Rational Fortran) is a
Features
Ratfor provides the following kinds of flow-control statements, described by Kernighan and Plauger as "shamelessly stolen from the language C, developed for the UNIX operating system by D.M. Ritchie" ("Software Tools", p. 318):
- statement grouping with braces
- if-else, while, for, do, repeat-until, break, next
- "free-form" statements, i.e., not constrained by Fortran format rules
- <, >, >=, ... in place of .LT., .GT., .GE., ...
- include
- # comments
For example, the following code
if (a > b) {
max = a
} else {
max = b
}
might be translated as
IF(.NOT.(A.GT.B))GOTO 1
MAX = A
GOTO 2
1 CONTINUE
MAX = B
2 CONTINUE
The version of Ratfor in Software Tools is written in Ratfor, as are the sample programs, and inasmuch as its own translation to Fortran is available, it can be ported to any Fortran system. Ratfor source code file names end in .r or .rat.
History
Ratfor was designed and implemented by
In 1977, at Purdue University, an improved version of the Ratfor preprocessor was written. It was called Mouse4, as it was smaller and faster than Ratfor. A published document by Dr. Douglas Comer, professor at Purdue, concluded "contrary to the evidence exhibited by the designer of Ratfor, sequential search is often inadequate for production software. Furthermore, in the case of lexical analysis, well-known techniques do seem to offer efficiency while retaining the simplicity, ease of coding and modularity of ad hoc methods." (CSD-TR236).
In comparison to the Ratfor preprocessor on a program of 3000 source lines running on a
With the availability of
IF (A .GT. B) THEN
MAX = A
ELSE
MAX = B
ENDIF
Initial Ratfor source code was ported to C in 1985
The original source was available in .
Ratfiv
Ratfiv is an enhanced version of the
The name of the language is a pun (Ratfor (RATional FORtran) -> "Rat Four" -> "Rat Five" -> RatFiv).
Ratfiv was developed by Bill Wood at the Institute for Cancer Research, Philadelphia, PA in the early 1980s and released on several DECUS (Digital Equipment Users Group) SIG (Special Interest Group) tapes. It is based on the original Ratfor by B. Kernighan and P. J. Plauger, with rewrites and enhancements by David Hanson and friends (U. of Arizona), Joe Sventek and Debbie Scherrer (Lawrence Berkeley National Laboratory).
Ratfiv V2.1 was distributed on the DECUS RSX82a SIG tape.[5]