Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site moncol.UUCP Path: utzoo!utcs!lsuc!pesnta!moncol!john From: john@moncol.UUCP (John Ruschmeyer) Newsgroups: net.lang.f77 Subject: Re: Translator from Rat4 to F77? Message-ID: <373@moncol.UUCP> Date: Sun, 9-Jun-85 14:59:19 EDT Article-I.D.: moncol.373 Posted: Sun Jun 9 14:59:19 1985 Date-Received: Mon, 10-Jun-85 14:24:10 EDT References: <2281@sun.uucp> <453@ho95b.UUCP> <26610@lanl.ARPA> <2850003@acf4.UUCP> <875@sdcsla.UUCP> <361@moncol.UUCP> Organization: Monmouth College, West Long Branch, NJ 07764 Lines: 60 >From: guy@sun.uucp (Guy Harris) >Organization: Sun Microsystems, Inc. >Message-ID: <2281@sun.uucp> > >> >and handles free-format input and some other preprocessor stuff. >> >The output is vanilla fortran 77, assuming that the input wasn't fortran-66 >> >dependent (e.g. one-trip do-loops, etc.). >> >> Hmmm... Has Ratfor been improved in the last few years? The Ratfor which >> came with our v7 system produces FORTRAN 66 as its output, not f77. >> >> This means that the resulting program is often a maze of GOTO's. > >F66 is pretty much a proper subset of F77; that's the sense in which Rat4 >produces F77. It produces code that should be compilable under either >compiler, assuming that the "plain FORTRAN" part of the code is compilable >under either compiler. [The following is a response to the above and to a mail reply I recieved.] I concede that the output of the RATFOR processor is f77 in that it will compile and run correctly with a FORTRAN 77 compiler. (On some compilers, the one-trip DO loop is a compile-time option.) I still maintain, however, that the output is really FORTRAN 66 in that it takes advantage of none of the features added in f77, such as the IF-THEN-ELSE construct. Now, why is this important to me? On one of our non-UNIX systems, we run a financial simulation program which was written in the early 1960's (FINANSIM by Greenleaf et al.). This program was written in *really* old FORTRAN and uses constructs such as the arithmetic-IF. Needless to say, it is nearly impossible to read. For the hell of it, I took a copy of it over to our UNIX system and ran it through struct. Voila, very readable RATFOR. It was actually possible to follow what the program was doing. Then I ran the program back through RATFOR. Yeech-o, lots and lots of GOTO's. All those nice RATFOR if-then-else's gone in an instant. The result was as bad, if not worse, than the original. I realize that normally the trick would be to do the program maintenance on the RATFOR code. Since we're dealing with a system that doesn't support it, however, the next best thing would be to use as much f77 capability as possible. -- Name: John Ruschmeyer US Mail: Monmouth College, W. Long Branch, NJ 07764 Phone: (201) 222-6600 x366 UUCP: ...!vax135!petsd!moncol!john ...!princeton!moncol!john ...!pesnta!moncol!john Silly Quote: "I wanted to call it 'Nautical Lady' and Fred wanted to call it 'Queen of the Sea'. So we took the first three letters of my name and the last three letters of his."