Path: utzoo!attcan!uunet!lll-winken!gandalf!jac From: jac@gandalf..llnl.gov (James Crotinger) Newsgroups: comp.lang.fortran Subject: Re: What is the FORTRAN for ? Keywords: FORTRAN, stupidity Message-ID: <65460@lll-winken.LLNL.GOV> Date: 27 Jul 90 17:27:15 GMT References: <1990Jul25.174153.16896@ecn.purdue.edu> <34523@ut-emx.UUCP> Sender: usenet@lll-winken.LLNL.GOV Organization: Lawrence Livermore National Laboratory Lines: 60 In article <34523@ut-emx.UUCP> mjl@emx.UUCP (Maurice LeBrun) writes: >In article <1990Jul25.174153.16896@ecn.purdue.edu> moshkovi@cn.ecn.purdue.edu writes: >>Please, don't consider my question offending, but why the hell in this world >>you people still using FORTRAN, while so many nice C around. > As many people have pointed out, FORTRAN is well suited for writing numerical codes. C isn't necessarily as well suited for this. The biggest problems with C are the lack of a real multidimensional arrays and the lack of an intrinsic complex number type. In C, a multidimensional array is just a pointer to the first data element in the array. There is no mechanism for doing "dummy dimensioned" multidimensional arrays unless the subroutine which does this calculates the offsets explicitly. This stinks. The alternative is to use pointers to pointers to floats and pass these around. The problem is that will greatly inhibit optimization. Not only is there the usual alias problem, but the compiler has no way of knowing if the skip from the start of on row to the next is a constant (it doesn't have to be---a float** is a more general data structure than a simple array). On vectorizing computers this is a killer. >As many people have expressed, Fortran usually produces the fastest >code on many high end systems. It is also typically far better >supported than any other language, which is a bit unfortunate. I'm not sure what Maurice means by "supported" here. My experience has been that software development tools for C are for more developed on most systems (CRAYs excluded) than those for Fortran. I'd give my eye teeth for a Saber C type environment that would work with Fortran as well as C and C++. > The >attitude that "there will never be any significant computation in any >language other than Fortran" is still prevalent in some circles, and >in fact has hampered getting a C++ compiler up on the Crays at NERSC >(formerly called NMFECC). > Yep, Fortran, like COBOL, has a lot of inertia. Not only is there a large body of Fortran code (and mixing Fortran and C is quite nonportable) in existance, there are also a large number of older programmers who just plain don't want to switch. From the perspective of a Fortran programmer, C++ addresses many of the shortfalls of C [functional shortfalls..if you don't like C's syntax, you won't like C++'s, but this is a subjective matter]. The down-side is that it is not at all clear C++ code will be easy to optimize/vectorize. > >Maurice LeBrun Institute for Fusion Studies >mjl@fusion.ph.utexas.edu University of Texas at Austin Jim -- ========================================================================= James A. Crotinger Lawrence Livermore National Laboratory // jac@gandalf.llnl.gov P.O. Box 808; L-630 \\ // (415) 422-0259 Livermore CA 94550 \\/