Path: utzoo!attcan!uunet!lll-winken!ames!haven!umbc3!mbph!hybl From: hybl@mbph.UUCP (Albert Hybl Dept of Biophysics SM) Newsgroups: comp.lang.fortran Subject: An exercise in futility Keywords: Fortran_standards resemble_a Demolition_derby Message-ID: <587@mbph.UUCP> Date: 16 Jan 89 21:54:30 GMT Organization: University of Maryland, School of Medicine, Baltimore, MD 21201 Lines: 95 The United States is about to spend some 4 gigabuck mapping the human genome. This is one of the best uses for which our tax dollars can be used. Already the knowledge gained by genetic mapping is contributing a better understanding of emphysema, hypertension, and many genetic diseases. Progress toward treatment and cures are just around the corner or even in clinical trial. The mapping project will generate long strings of 'A's, 'C's, 'G's and 'T's. Sequences can be 1 to 1 million or more nucleic acids in length. When searching for a promoter region on a gene or asking which restriction enzymes will cut a DNA sequence, a researcher needs to locate the position of a short recognition sequence on the long DNA sequence. He could, for example, use the intrinsic INDEX function in an expression like: J = INDEX(DNA,'CGGCCG') At first glance FORTRAN appears to be a useful language to use for such projects. However, because it is so full of quirkish ambiguities and because it is no longer a portable language, using it is engaging in an exercise in futility. In message <3704@s.cc.purdue.edu> ags@s.cc.purdue.edu (Dave Seaman, Purdue University) claims: > ...THEY ARE ENFORCING THE STANDARD ... Consider the following program: PROGRAM FUTILE * Repeat this program after increasing the value of K until the program fails. PARAMETER (K=24) CHARACTER AND(K)*1 CHARACTER DNA*(K) EQUIVALENCE (DNA,AND) * DNA(K-23:K) = 'An exercise in futility!' PRINT *,K PRINT *,(AND(J+K-24),J=1,24) STOP END What does the ANSI X3.9-1978 standard say are the maximum allowable sizes for the character array AND(K)*1 and the character variable DNA*(K)? Are the maximum allowable sizes the same? Does it allow the equivalence statement? I believe that most of the standards committee intended that values should be the same and the limit determined by the amount of available core in the processor executing the job. The equivalence is legal so long as the variables are legal. Rush to you vendor's FORTRAN Language Reference Coloring Book, what does it say and in what color does it say it? Why should DNA*256 be LEGAL on most systems but ILLEGAL when using RM fortran on an IBM PC/AT or the SVS fortran on an AT&T 3B1? Why is DNA*501 illegal when using CMS fortran on an IBM4341? Why is DNA*513 illegal when using FTN fortran on an UNISYS 1100? Why is DNA*1001 illegal when using **X Fortran on a VAX VMS machine? Of the compilers that I have used, only the XLA+ fortran on an AT&T 3B2 machine does what I think the standard specifies. DNA*750000 works! When I increased the value of K to 1000000 and above I obtained to following diagnostics: (k=1000000) Ld fatal: Cannot complete output file a.out. Write error (K=1097152) Assembly: Trouble Writing; probably out of temp-file space Surely a FORTRAN language validation suite would have prevented such abominable implementations of the standard. Not even the most convoluted interpretation of sections 1.3.2.(4) and 1.4 can justify such capriciousness. The purpose of the Fortran ANSI X3.9 1978 standard "is to promote portability of FORTRAN programs for use on a variety of data processing systems." Pray tell, based on the above examples how can anyone say that the maximum length for a string variable is predicable or portable? Steve Weintraub has shown that the USENET can be used to rapidly discover ambiguities in a language standard. Discussions in this newsgroup can propose corrective language. The real problem is how to incorporate the new language into the standard. Clearly sections 1.3.2.(4) and part of section 1.4 MUST be deleted! The standards making body should produce a "Cumulative Annual Pocket Part" that is published in FORTRAN forum and other appropriate media. There must be an adjudication mechanism. The standards organization must have a registered trademark for the FORTRAN Language. A Fortran Validation Suite must be created, updated and revised annually. Before a compiler is allowed to use the trademark, it must pass the validation tests. Unless a Fortran Standardizing Organization is willing and able to legally enforce the Standard, this discussion will have been nothing but an exercise in futility. ---------------------------------------------------------------------- Albert Hybl, PhD. Office UUCP: uunet!mimsy!mbph!hybl Department of Biophysics Home UUCP: uunet!mimsy!mbph!hybl!ah University of Maryland CoSy: ahybl School of Medicine Baltimore, MD 21201 Phone: (301) 328-7940 (Office) ----------------------------------------------------------------------