Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!elroy!cit-vax!ucla-cs!zen!ucbvax!cevax.berkeley.edu!landers From: landers@cevax.berkeley.edu (Joe Landers) Newsgroups: comp.lang.fortran Subject: Re: FORTRAN 8x (long) Message-ID: <21817@ucbvax.BERKELEY.EDU> Date: Tue, 17-Nov-87 00:12:11 EST Article-I.D.: ucbvax.21817 Posted: Tue Nov 17 00:12:11 1987 Date-Received: Thu, 19-Nov-87 05:36:04 EST Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: landers@cevax.berkeley.edu (Joe Landers) Organization: University of California, Berkeley Lines: 100 The FORTRAN 8x document (X3.9) describes a "FORTRAN family of standards" which include 3 categories: new features, primary features and decremented features. The last, "decremented features" has 3 subcategories for what the committee considers "outmoded" language features. They are: "deleted features," "obsolescent features" and "depreciated features." While the definitions and reasons for the terms are described, THERE ARE NO DELETED FEATURES IN FORTRAN 8x. rick@svedberg.bcm.tmc.edu writes [I folded the long lines.]: > ... >You will force a rewrite of many millions of lines of working code. > ... >I have no objection to an evolutionary path for an existing >language, but to totally rework the definition as it seems to be >proposed is stupid. No modifications of existing programs will be necessary because the standard is "upward compatible" with FORTRAN 77. I, too, think that a language should evolve, but there is disagreement on the level of evolution. Two important concepts have arisen out of programming language design in the last 20 years. The first is the concept of "data types." [A data type is a set of values, a description of the operations defined on them and a notation for using them.] The second is "variable scope." [The scope of a variable is the piece of a program where the name of the variable has the same meaning]. The FORTRAN 77 language standard provides only a small set of built in data types which are tied to the underlying machine architecture. A single precision variable on one machine may have a larger range and precision than a single precision variable on another machine. The only data structures permitted in FORTRAN 77 are the array and the common block. The FORTRAN 8x standard allows the user to define new variable types in terms of either simple "basic" types or in terms new, defined types. Data types may be parametrized. While there still is no pointer type, array objects may be allocated dynamically. You can specify floating point numbers by exponent range and digits of precision. Operations on arrays are available. In FORTRAN 77, the data associated with a variable may become associated with other names through the use of COMMON and EQUIVALENCE statements. All variables in a COMMON block are available in the program segment where the COMMON block is included. Furthermore, there is no mechanism to check the integrity of a COMMON blocks with the same name. If you change one variable in the middle of a block from type "integer" to type "double," there is no mechanism to propagate the change. In FORTRAN 8x, a MODULE/USE facility is available. Common data structures and programs can be grouped into a MODULE (and optionally defining some portions as PRIVATE) and USE'd in different subprograms. When a definition in a MODULE is changed, all of the modifications are carried out. mcdonald@uxe.cso.uiuc.edu writes: [I folded long lines.] >Perhaps someone will explain how my present programs will work >without common, if they now use it? Will you volunteer to convert >all my old programs to F8X or C. If you won't do the job for me, >why not? Your programs will work the same, because COMMOM blocks are still part of the language definition. It will not be necessary (at least in 8x) to convert ANY programs. If you write new programs, however, you might want to try the new facilities because they offer a lot more power and flexibility to your programming style. rick@svedberg.bcm.tmc.edu writes (again): >There are three rubs here. > ... (some rubs deleted) >3) There is no guarentee that a vendor will always provide the f77 >compiler if he is only required to provide a fortran compiler. > >I do believe that a good case could be made for developing a >language for sicentific use to replace Fortran which does reflect >the progress over the last 30 years in language development, just >don't call it fortran. Again, 8x is upward compatible. Programs which conform to the FORTRAN 77 standard will run under 8x. And again, I too believe that a good language for scientific computing is necessary. The problem, as you described, is to take advantage of the already existing large body of FORTRAN code. Should the modifications to FORTRAN only involve cosmetic changes in control structures? What do you gain in writing FORTRAN programs where each element of an array has to be explicitly referred to? Couldn't a vendor do a better job by supplying a collection of array intrinsics (as in 8x) rather than have you write them each time? I believe that FORTRAN 8x is a very valuable and worthwhile extension. It seems to me that it provides the programmer with some very powerful tools, without destroying the investment in the large body of existing code. joe landers landers@cardinal.berkeley.edu P.S.: You can order a copy of the standard, X3.9, from Global Engineering Documents, Santa Ana, California. (800)854-7179 or (714)540-9870. Mine came without a cover, looks like a third generation copy, and it costs $50.00, but you should get it and send your comments to ANSI. It's interesting reading.