Path: utzoo!attcan!uunet!tank!ncar!mailrus!cornell!uw-beaver!uw-june!david From: david@june.cs.washington.edu (David Callahan) Newsgroups: comp.lang.fortran Subject: Re: FORTRAN 8x parser/lexer .NE. compiler Keywords: FORTRAN 8x Message-ID: <6148@june.cs.washington.edu> Date: 20 Oct 88 19:18:50 GMT References: <656@convex.UUCP> Reply-To: david@uw-june.UUCP (David Callahan) Distribution: comp.lang.fortran Organization: U of Washington, Computer Science, Seattle Lines: 110 The following is a reply to Steve Rown (rowan@convex.COM) who used the Convex Ada implementation to measure the difficulties in implementing Fortran 8x. I am neither an expert on Fortran 8X nor on Ada so please bare with my mistakes and questions. #Granted, an Ada compiler is simpler than a FORTRAN 8x compiler but this #should provide some idea of the magnitude of the problem. Would someone please motivate this statement? Ada requires some type-inference, generic packages, and handling of multi-tasking and execptions. What are the features (aside from array-valued expressions)in Fortran 8X that require similar amounts if implementation effort? #The front-end of the CONVEX Ada compiler, the portion that performs #lexing, parsing, and semantic analysis is 100,000 lines of C code. # ... The Ada parser and lexer come to less than 5,000 lines of the #front-end total. It does not follow that a Fortran 8X front end will have similar characteristics. #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. (I don't want to argue against using vectorization technology for optimizing Fortran 8X, but the author implies that it is necessary for essentially any efficient implementation). Dependence analysis is only part of a vectorizer. In particular, to optimize array operations, you don't have to recognize induction variables and loop invariant expressions. You don't have to pattern-match for things like sum reductions and min/max reductions. Hence, the 80k figure may be very high. The necessity of removing the implied temporary is unclear since its lifetime is short. Of coarse, when adding one to every element of a gig-word array you don't want to copy it, but it seems reasonable that for a compiler to handle the easy cases well and the let the programmer help (eliminate copies by adding loops) when things get out of hand. Explicit array syntax is intended to improve the expressiveness of the language not allow programmers to be oblivous to the efficiency of processing huge amounts of data. #Now lets add say 20,000 lines of code for the library managers necessary #for dependent compilation. What are the aspects of Fortran8x that require more library management than "incude" files? The UNIX world learned how to handle "compilation dependencies" outside of the compiler. What about Fortran 8x invalidates those techniques?. # ... 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). Not to disagree with the statement, but this is not a conclusion the authors make in the cited tech report. #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. Why is parallelization necessary? You work for a company that markets a parallel computer and I work for one that intends to, but that is certainly not a requirement of most implementations of Fortran 8X. #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. Ada was developed from scatch without existing experience with a subset and includes a very complex runtime environment to support multitasking and execption handling. Aside from recursion and dynamic allocation, does Fortran 8x have any feature that requies similar support? Won't any substantive change to the language (like user defined types, recursion, bit types, and dynamic memory allocation) require several years before compilers are available and reliable? Aside from the array syntax, what features can be deleted that will significantly reduce the development time? #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. A couple of final questions in reply: is it necessary that the "average" Fortran user (if such a beast exists) want or need a feature for that feature to be added to the language? Shouldn't it be sufficient that some substantial portion of the community would find it useful, particularly given that Fortran 77 is a subset so that the only noticable change would be in compile speed? #Steve Rowan #rowan@convex.COM David Callahan Tera Computer Company (david@june.cs.washington.edu)