Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!convex!mozart!rowan From: rowan@mozart.uucp (Steve Rowan) Newsgroups: comp.lang.fortran Subject: FORTRAN 8x parser/lexer .NE. compiler Keywords: FORTRAN 8x Message-ID: <656@convex.UUCP> Date: 18 Oct 88 19:51:39 GMT Sender: news@convex.UUCP Reply-To: rowan@convex.COM (Steve Rowan) Distribution: comp.lang.fortran Organization: Convex Computer Corporation, Richardson, Tx. Lines: 75 Up to this point I have been satisfied sitting on the sidelines listening to the debate on 8x. I cannot sit back and stay quiet when I find comments in the WG5 reports like the following: >An 8x lexer and parser was demonstrated for the full Fortran >8x language. The demonstration showed that the >implementation of full Fortran 8x can be done effectively >and in a timely manner. I realize that person was just reporting what happened at the WG 5 meeting but the statement is still wrong. Anyone that expects the lexer and parser for any language, even FORTRAN 8x or Ada, to take more than 5% of the development time does not understand the problem. Anyone who has taken an undergraduate compiler course should be able to create a lexer and parser for FORTRAN 8x in six months. I don't think I would hire someone right out of school if I didn't think they could do it in three months. In the early days of computing, when parsers were written by hand and code generators were naive, parsers were half the job. Those days ended in the late 60's however. Let me give some real world examples from our Ada complier. A much closer approximation to a FORTRAN 8x compiler than this example. Granted, an Ada compiler is simpler than a FORTRAN 8x compiler but this should provide some idea of the magnitude of the problem. The front-end of the CONVEX Ada compiler, the portion that performs lexing, parsing, and semantic analysis is 100,000 lines of C code. Roughly the size of our ENTIRE vectorizing/parallelizing FORTRAN compiler. The Ada parser and lexer come to less than 5,000 lines of the front-end total. Now lets add the vectorized and code generator. Let's say another 80,000 lines of C again taking the CONVEX Ada compiler as an example. Before it's said that we don't need a vectorized let me point out that one has to do exactly the same data dependency analysis to determine when the extra temps introduced by FORTRAN 8x's copy semantics can be removed. One also has the fuse the implied 8x array notation loops into larger loops so you don't pay the loop overhead so often, then you have to vectorize the merged loops. Remember we want a good FORTRAN 8x compiler for whatever the target machine may be. Now lets add say 20,000 lines of code for the library managers necessary for dependent compilation. Now we have a compilation system that is twice as big as the compiler Callahan, Dongarra and Levine found to be the best vectorizing FORTRAN compiler in the world (See "Vectorizing Compilers: A Test Suite and Results, Technical Memorandum No. 109, Mathematics and Computer Science Division, Argonne National Laboratory). To develop a full FORTRAN 8x compiler which will optimize and do parallelization (without vectorization) will take many person-years to complete. I think one can see how the numbers add up. One other Ada example and I will stop beating this dead horse. Ada lexers and parsers were available in 1979. The first production quality Ada compiler was not validated until 1985. I choose the DEC compiler as the first real Ada compiler. The academic Ada-ED compiler just does not count in my book. If I have missed something here I would be interested in hearing the counter argument. I have only been writing vectorizing compilers, FORTRAN, C and, Ada for the past ten years. I hope this did not come off as too much of a flame but as my public review comment stated, I feel we are doing the FORTRAN community a disservice by proposing a language with features the average FORTRAN user does not want or need. I also think WG5 is doing the community a disservice by proposing the next ALGOL 68, an elegant language that no one implements a compiler for, but that is their business. I assume I will get a change to voice my opinions about the ISO FORTRAN 88 draft early next year. Steve Rowan rowan@convex.COM