Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ttrdc.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!mgnetp!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: net.lang.c,net.lang.f77 Subject: Re: Fortran to C translator Message-ID: <212@ttrdc.UUCP> Date: Thu, 13-Jun-85 01:37:48 EDT Article-I.D.: ttrdc.212 Posted: Thu Jun 13 01:37:48 1985 Date-Received: Fri, 14-Jun-85 00:01:07 EDT References: <> <338@cubsvax.UUCP> <112@ho95e.UUCP> Distribution: net Organization: AT&T Teletype Corp., Skokie, IL Lines: 29 Xref: watmath net.lang.c:5378 net.lang.f77:314 There have now been some postings on the net in reply to this question that have pointed out that the Unix f77 compiler does not produce C code anywhere in its action, which is true. However, even if it did, I am sure the code would be just as bug-ridden as what f77 produces presently in the executable. (In a following article I have a few flames on the subject.) I have heard of a Fortran to C translator, but never had a chance to try it. It was advertised several months ago in Electronic Design News, or one of the other advertisement-laden 'freebie' EE publications. I can't seem to dig it up right now, but I'm sure I saw it. My impression (and I could be mistaken) is that it would be of limited value over f77 itself, if f77 were bug free (unfortunately, it isn't). The calling conventions of Fortran (variables passed to subroutines/functions are done so by address, necessitating lots of indirect memory references in the routines when these variables are used) and the need for the special types of I/O, among other vagaries of Fortran, would handicap the result. If there was a burning need to modify the source code anyway, it might be better just to hand-translate the algorithm into C, taking advantage of the greater powers of C. I imagine that a Fortran to C translator would make it easier if the code were to be used in bulk, and it would let the code be put on most any Unix machine, letting cc worry about the exact machine code involved, IF the trans- lator were perfect or near so; it would be a great headache to have to debug the C code because a particular C compiler didn't like it. It would be quite a challenge to put out C code portable across absolutely ALL compilers. D. Levy AT&T Teletype Corp. Skokie, Ill.