ISO/IEC JTC1/SC22/WG5 N1138 To: SC22WG5 From: X3J3 Subject: Response to T11 Dear SC22WG5, X3J3 believes that it is desirable for Conditional Compilation (CoCo) to be a language feature that shall become part of standard Fortran before the year 2000. There are two parts of this decision. First, the decision that CoCo is needed as part of standard Fortran. Second, the decision to standardize a CoCo language before the next Fortran (200x). This paper is an overview of the X3J3 proposal to SC22WG5 that the current work item be split to include CoCo as an item for completion before the next Fortran. A brief technical discussion of CoCo is followed by some support for the urgency of the standardization of a CoCo definition. Finally, a couple of CoCo definitions are mentioned and the idea of extending beyond CoCo and offering a preprocessor with macro expansion and text substitution is introduced. The following words resulted from the Breckenridge discussion: "In response to the WG5 resolution T11, the US proposes to WG5 that the work item be split to create another part of 1539 which addresses conditional compilation. David Epstein volunteers to be the project editor. The project editor agrees that the direction to be taken for a conditional compilation feature will be determined by vote of the primary development body." WHY COCO IS NEEDED ------------------ A number of issues has driven the decision to standardize CoCo: (1) A standard CoCo is the final piece of the Fortran portability puzzle. Having CoCo will add to the strength of Fortran's standardization efforts. (2) Fortran customer requests for CoCo has been consistent. (3) Multiple Fortran 90 processors are beginning to become available on most systems. (4) Although Fortran's major market is scientific programming, Fortran 90 has added the basic tools for Fortran to be chosen as a general purpose, portable programming language. Surely, those that are choosing C merely for portability could now consider using standard Fortran together with a CoCo tool. The most popular use of CoCo is to aid in the design and implementation of writing portable programs. In the past, this has led to many occurances of a particular if construct designed to selecting a particular operating system. For example: #?$ if (system == sysA) open (unit=10, file=sysAfilename) #?$ elif (system == sysB) open (unit=10, file=sysBfilename) #?$ elseif (system == sysC) open (unit=10, file=sysCfilename) #?$ else handle an error #?$ endif It is reasonable to expect that some Fortran programmers will employ similar versions of the above if construct that chooses between older versions of Fortran (FORTRAN 77 for example), and the current Fortran. This is particularly likely for the Fortran customers with years of investment in an older version of Fortran but with an equally large projected investment in maintaining and enhancing this code for years to come. Note that the availability of standard CoCo will alleviate the need for the HPF language to continue to require the !HPF$ prefix. This is an example of how the number of benefits to a standardized CoCo is not limited to portability. WHY COCO BEFORE 200x -------------------- Some Fortran vendors and customers are currently waiting for a standardized CoCo. One person, in a letter to X3J3, mentioned that he is unable to make the switch to Fortran 90 without some sort of CoCo support. His vendor, as well as others, offered a CoCo language in their FORTRAN 77 product and has yet to offer a CoCo facility in their Fortran 90 product. Both vendors and programmers are waiting on the standardization team. TWO COCO DEFINITIONS -------------------- A Fortran Conditional Compilation (fcc) definition will be distributed through email before the 1995 November SC22WG5 meeting in San Diego. fcc is designed as the ultimate CoCo definition for those that believe exisiting fpp and cpp definitions are valuable methods to achieve CoCo. An alternative approach is offered with the Conditional Compilation Facility (CCF). CCF is designed as the ultimate CoCo definition for those that believe a subset of the Fortran definition is a valuable method to achieve CoCo. MORE THAN COCO? --------------- While discussing CoCo, a decision needs to be made as to whether or not a full preprocessor language that adds macro expansion and text substitution to CoCo is desirable. Making this decision first will prevent the situation of attempting to make a three-way decision or the possibility that a CoCo definition need future extensions to offer a more powerful language.