Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!pyramid!prls!philabs!ams From: ams@philabs.Philips.Com (M. Ali Shaik) Newsgroups: comp.lang.fortran Subject: Re: Why Does MS Fortran Compiler Need So Many %*&^%!! Floppies? Message-ID: <1528@briar.Philips.Com> Date: Thu, 6-Aug-87 10:07:26 EDT Article-I.D.: briar.1528 Posted: Thu Aug 6 10:07:26 1987 Date-Received: Sun, 9-Aug-87 07:24:00 EDT References: <1471@briar.Philips.Com> Organization: Philips Laboratories, Briarcliff Manor, NY. Lines: 80 In article <1471@briar.Philips.Com>, ams@philabs.Philips.Com I writes: >....whine about Fortran compilers.. Mark Moraes of CSRI, U. of Toronto, e-mailed me some good stuff in response, which I'm posting (without permission & with apologies :-): ______________________________________________________________________ A good question, and one that I've often asked myself, when flipping floppies. 1. FORTRAN syntax is not easy to parse, and requires a large syntax analyser, whereas Pascal is very elegant (from a compiler writer's viewpoint!) syntax, and was designed to make a compiler one-pass only. FORTRAN on the other hand, cannot get by without 3 passes, at least. FORTRAN syntax is the most difficult of any language to parse, and cannot even be rationally specified in formal notation like BNF. As a classic example, the statements DO30I=1,50 and DO30I=1.50 are semantically VERY different, but just differ by one character, and till the compiler reaches that point, it has no idea whether it is in a DO statement or in an assignement. For another classic example, 100 FORMAT(A3)=5 and 100 FORMAT(A3) illustrate the problem in FORTRAN syntax very well. 2. Turbo Pascal is a wonderful development environment, but it cheats a little by taking generating .COM files, and thus limiting the user's object code to only 64K max. However, Turbo Pascal amply demonstartes why Pascal is a good language to write compilers for - small, regular, elegant - the computer scientist's language. 3. Data structures and stuff don't require very much compiler room - they are very simple to implement (All it really takes is an indirect addressing command). Most of the complications in the data structures are in user programs, but because of the utterly regular structure of Pascal, it is very easy to compile. 4. Turbo also cheats by doing a one-step scan, parse and link to produce object code directly. While this makes for a very fast compiler, it does not make it easy to port the compiler to other machines, and does not allow the user to link Pascal programs with C or FORTRAN subroutines. Microsoft tries to use the same back end for their compilers (i.e. PAS2 and PAS3) and leave only PAS1 identical, if I remember right. (It's a while since I used their compilers - I hate them!) 5. I suspect Microsoft wrote the compilers with the viewpoint "non computer-wizards will use BASIC, if they use compilers, they must have hard disks (and hence lots of money - comparing Microsofts prices with Borland makes me sick:-)". I find the Ryan-McFarland Pro FORTRAN compiler much nicer, and generates compact efficient code. Microsoft's Pascal and FORTRAN compilers generate such lousy code that I wonder whty they claim tehm to be optimizing. 7. In short, apart from Microsoft BASIC, I am very suspicious of their compilers. Their F77 is only the specified ANSI subset, not the full ANSI - at least the version I have. I refuse to waste any more money on any more of their compilers. I have version 2 of their pascal and Fortran, and Turbo Pascal. I have used Ryan-McFarland (IBM Pro. FORTRAN) at work (it requires a hard disk and 8087) and find it nice, but slow to compile even then. FORTRAN is not a language for microcomputers. (neither is COBOL). Turbo is a great product, till you want to write really big programs, at which point you have to start overlays, which I though went out with the PDP-11! Pity, because I really like it. And I'll never understand how they crammed a Wordstar like editor and a Pascal compiler into 35K - even for Pascal, that's extraordinary. 8. Any serious compiler on the severely brain-damaged 8086 family, below the 80286 takes a hell of a lot of work - unless you duck the issue and keep to 64K code only. "Segments are for worms" - Just look at the FORTRAN compilers on the Amiga or the Atari ST, or the Stride Micros, or on Suns - MUCH smaller. Regards, Mark. (moraes@csri.toronto.edu)