Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!cronkite!exodus!boise.Eng.Sun.COM!wsb From: wsb@boise.Eng.Sun.COM (Walt Brainerd) Newsgroups: comp.lang.fortran Subject: NAG Fortran 90 announcement Keywords: Fortran 90 Message-ID: <15634@exodus.Eng.Sun.COM> Date: 21 Jun 91 21:55:38 GMT Sender: news@exodus.Eng.Sun.COM Lines: 233 [Richard Maine pointed out that this was in the Fortran Journal. Normally, we wouldn't give away our "scoops", but we think this will be of general interest, historical and otherwise. One reader already has complained that this a commercial announcement and possibly "vaporware", but I think many will want to know about it and evaluate the information for what it is--i.e., based mostly on information from NAG. We'll try to provide a review as soon as it is feasible. Apologies for sending troff (acutally profficient) source. Officially, it's copyrighted of course, but please distribute this freely as you like. --Walt Brainerd, Editor, Fortran Journal.] From the 1991 May/June issue of the Fortran Journal: ..Title "The First Fortran 90 Implementation" The approval of Fortran 90 as an international standard was reported in the ..r "Fortran Journal" in just the last issue. Now we are pleased to learn of the world's first Fortran 90 implementation, available soon from Numerical Algorithms Group, Ltd. This article presents some information about this software and other NAG activities of interest to the Fortran programmer. ..pp NAG has the first announced compiler that implements all of Fortran 90. The output language is Kernighan and Ritchie C, chosen to make it portable to many architectures and operating systems. It has been tested extensively. ..sub.head "Design Goals" The design goals of the development were: ..in.level bu ..ip to produce a true compiler, not just a translator ..ip to provide good speed of compilation and reasonable efficiency of execution ..ip to provide good error checking with comprehensible error messages ..ip to produce a full standard-conforming compiler, with all constraints identified ..ip to provide \f2no\fP language extensions ..ip to produce a modular system that can be modified easily and used to build other software tools and compilers ..out.level NAG has been able to produce this compiler in such a timely manner because they started early and maintained commitment to the development. Experiments in Fortran 90 compiler construction started at NAG as long ago as 1987. The current system is the result of nearly 18 months development by Malcolm Cohen and others at the NAG offices in Oxford, UK. ..pp The NAG f90 compiler is not a ..q "stretched" Fortran\ 77 system, enhanced beyond its original design. NAG has continuously tracked the discussions, debates, and draft standards proposed for Fortran 90 since the Fortran 8X saga began and has incorporated the changes as agreed into the compiler design. It is a true compiler in that it utilizes global information to generate the resulting C code. ..pp Testing of the NAGWare f90 Compiler has gone on continuously during development. NAG has encouraged the early development of an extensive Fortran 90 test suite by Brian Smith, a leading member of the standardization activity; this test suite has been used at all stages to ensure conformance of the activity. Additionally, NAG's commitment to Fortran 90 and the development of Fortran 90 based facilities has meant the compiler has received extensive internal use. ..pp The use of modular construction and tools such as \f2yacc\fP mean that the compiler is supportable and a separate maintenance service is available. Extensive error messages are given by the compiler, both those required by the ISO standard and additional information. The messages are informative rather than cryptic and often contain context information to assist in identifying and rectifying the problem. For this reason the compiler is particularly suited to teaching and for programmers wishing to update their skills to the new language, as well as those who want to develop Fortran 90 programs. ..sub.head "Implementation Methodology" The compiler is written in Kernighan and Ritchie\ C. The two independent lexers (one per source form) are hand coded. The parser is generated using \f2yacc\fP with additional error recovery added. ..pp The compiler has four passes, and the passes have been kept distinct to improve maintainability and to allow re-use of the components in tools and customized compilation systems. The four passes are as follows: ..nr ip1.type 0 ..in.level ..nr ip1.indent .8i ..nr ip1.hang .8i ..ip "Pass\ 1:" Lexical and syntactic analysis is performed; the symbol table and abstract syntax tree are built. ..ip "Pass\ 2:" Semantic analysis is done; the parse tree is annotated; the symbol table is filled in; all major error and constraint detection takes place. ..ip "Pass\ 3:" Code is generated form the parse tree transformation. ..ip "Pass\ 4:" The code is output; declarations are generated; the flattened parse tree is transformed to K&R C source code (the system can be modified to produce other dialects). ..out.level ..nr ip1.type 1 ..pp Passes 1 and 2 have been undergoing beta test for many months. Passes 3 and 4 are being completed at present and have recently undergone internal alpha-test. By the end of June, 1991, the complete system, including the run-time library, will have been throughly beta tested. ..pp The compiler will have the full range of intrinsic functions described in the ISO standard. Intrinsics are implemented using a combination of a run-time library and in-line code (produced by the code generator), depending on efficiency and implementation complexity. ..pp The compiler will have a full implementation of the input/output capabilities of the standard, including list-directed, formatted and unformatted, namelist, and nonadvancing input/output. Input/output will be handled through a run-time library written in C. ..sub.head "Documentation" Documentation of the system will be brief. A note will describe the installation of the software and a short document will be provided to describe its use and any implementation specific information. In addition, NAG intends to provide a copy of the book ..i "Fortran 90 Explained" by Mike Metcalf and John Reid. ..pp Because of the implementation language chosen (Kernighan and Ritchie\ C), the compiler and its output code will be highly portable. During porting, however, there may need to be modifications to ensure variable storage is correctly aligned (i.e. byte aligned, short aligned or long aligned). The performance of the compiled Fortran 90 code will be directly dependent upon the C system and run-time libraries employed. ..sub.head "Debugging" In general the C code resulting from the compiler is legible. It contains directives that set the file name and line number so that run-time errors are reported with respect to the original Fortran 90 source line. These directives also allow the relationship between the Fortran 90 code and the resulting C code to be more clearly understood. The Fortran 90 variable names are maintained in the source code. A semantics checking version of the compiler (one without the third and fourth phases) is available and this can dump a human readable form of the parse tree and symbol table information. ..sub.head "Availability" NAG will be launching the NAGWare f90 Compiler in June 1991. The compiler will be available initially on some Unix workstations. The system will be provided to the user in executable form only. Later implementations will include non-Unix hosts. The licensing of the system will be on a per-machine basis. Costs will be scaled by machine power. Annual maintenance will be available. The user will require access to a C compiler and run-time system; normally the one provided by the hardware or operating system vendor will suffice. ..pp In addition to selling the portable version of the compiler NAG is prepared to sell or license the Fortran 90 compiler technology to interested parties. The nature of the sales is open to discussion and negotiation. For example, it is possible to use the compiler front-end (passes 1 and 2) to link in with existing code generation, optimization, and tool technologies. In addition, NAG is willing to discuss consultancy to assist in modifying the compiler to integrate it into existing or planned systems, back-ends, and language extensions. ..last.line -28P ..sub.head "Other Fortran 90 Activities at NAG" Much of the testing is being undertaken in association with the development of a comprehensive Fortran 90 test suite. NAG will be launching the test suite as a product aimed at compiler writers during the second or third quarter of 1991. NAG will also be announcing a Fortran 90 Compiler/Tool Validation Service. A Fortran 90 tool suite containing polishing, transformation, and analysis tools will be launched in the near future. A Fortran 90 numerical library is undergoing development. ..sub.head "Fortran 77 Tools" NAGWare f77 Tools will also be launched during June 1991. They are a collection of tools for processing, analyzing, and transforming Fortran 77 source code. These programs include a ..q "pretty printer" , a declaration standardizer, a tool to change from single to double precision or vice versa, a restructuring tool, and a program to provide a static analysis of a whole program, producing a call graph, and a portability verifier. The tools can be used in a range of ways\(emquality assurance, standardization, porting support or simply in association with normal development. Regular use of the tools will speed development by helping to prevent and find errors and in making the source code easier to read and understand. Real benefits can be gained from the use of the tools during maintenance of existing software as the checks help to ensure that modifications are properly applied and that the style of the code remains consistent. ..pp For more information about the NAG Fortran 90 compiler and other tools, contact: ..list.start i In the UK: NAG Ltd. Wilkinson House Jordan Hill Road Oxford, OX2 8DR, UK +44 865 511245 865 310139 (fax) ..sp .5 In the US: NAG Inc. 1400 Opus Place, Suite 200 Downers Grove, IL 60515-5702 USA +1 708/971-2337 971-2706 (fax) ..list.end -- Walt Brainerd Sun Microsystems, Inc. walt.brainerd@eng.sun.com MS MTV 5-40 Mountain View, CA 94043 415/336-5991