Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!usc!apple!motcsd!mcdcup!mcdchg!tellab5!mtcchi!levy From: levy@mtcchi.uucp (2656-Daniel R. Levy(0000000)0000) Newsgroups: comp.lang.fortran Subject: Re: GNU Fortran: Help, Anyone? Message-ID: <1990Jul22.085640.19254@mtcchi.uucp> Date: 22 Jul 90 08:56:40 GMT References: <1990Jul17.165053.2336@mtcchi.uucp> Distribution: comp Organization: Memorex Telex Corporation NSBG/STP Lines: 53 burley@world.std.com (James C Burley) writes: >In article <1990Jul17.165053.2336@mtcchi.uucp> levy@mtcchi.uucp (2656-Daniel R. Levy(0000000)0000) writes: > >Hi. I'm working on GNU Fortran. In particular, the front end; the idea > >being that, once I finish it, we "simply" attach it to GCC (the GNU C > >compiler) and "just" write a run-time library and out pops a free Fortran > >compiler. > How about starting with, or at least going for link compatibility with, AT&T's > _freeware_ f2c converter/compiler? There is lots of room to expand their > good but rather basic standard library and plain Fortran-77 capability. > You could add Fortran-90 features, VMS-style goodies, and more to that > platform, and it feeds just about any K&R or ANSI C compiler. >Looks like I wasn't clear in my original posting: I'm not writing a Fortran- >to-C converter, but an actual Fortran compiler front end that will replace >the C front end in a copy of the GNU C compiler to make a GNU Fortran compiler. >That is, the output of the GNU Fortran compiler will be assembly code; there >won't be an intermediate "C code" phase. >The reason for this is that FSF wishes to ship a serious compiler that >achieves high benchmark performance. No matter how good the translation to >C, some Fortran benchmarks will perform poorly when compiled by a C compiler >because Fortran makes guarantees to the optimizer that C does not, especially >in areas like array handling. True in theory. In practice, I've found the output of f2c to produce faster code than f77 on every UNIX platform I've tried (including Sun, who has really jazzed up their f77 implementation) using compute-intensive benchmarks such as SPICE. If you can beat out f77, and do it in a truly portable way, more power to you and good luck. >Whether FSF will end up shipping both a true F77 (and later F90) compiler >AND a corresponding Fortran-to-C translator is yet to be seen. But the >current priority is to make a real compiler, not a transformer. AT&T's C++ (even if not GNU's) started as a package comprising a preprocessor feeding a C compiler, why not your FORTRAN compiler? A bonus would be easier debugability; it's easier to follow C code than assembly unless you're a real machine-head. And you could get much if not all of your FORTRAN-specific optimization back if you could make it put out appropriate pragmas for the benefit of GCC's optimizer. Remember, the C intermediate form does not have to be beautiful (f2c's isn't, and doesn't pretend to be), just correct. I/O is handled by calls to appropriate libraries, not by recasting into the likes of fscanf() and fprintf(). -- Daniel R. Levy * Memorex Telex * Naperville IL * ..!uunet!tellab5!mtcchi!levy So far as I can remember, there is not one ... therefore be ye as shrewd word in the Gospels in praise of intelligence. as serpents and harmless as -- Bertrand Russell [Berkeley UNIX fortune] doves -- God [Matthew 10:16]