Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!unmvax!ariel.unm.edu!ghostwheel.unm.edu!john From: john@ghostwheel.unm.edu (John Prentice) Newsgroups: comp.lang.fortran Subject: Re: Fortran -vs- C (yet again) Message-ID: <1990Nov25.082430.3229@ariel.unm.edu> Date: 25 Nov 90 08:24:30 GMT References: <1990Nov24.002836.19739@ariel.unm.edu> <1270009@hpcllmv.HP.COM> Sender: news@ariel.unm.edu (USENET News System) Organization: University of New Mexico Math Dept., Albuquerque, NM Lines: 37 In article <1270009@hpcllmv.HP.COM> jbc@hpcllmv.HP.COM (Jeff Caldwell) writes: > >I work at Hewlett Packard and currently write/maintain/enhance both the >Fortran and C compilers for 4 different platforms (different machine types). >I feel C is a much better language for sophisticated datatype/structure >manipulation. It's ease of use of pointers and structures is unmatched >by even the most robust implementations of Fortran. Fortran, on the other >hand, allows you to do terribly perverse things to memory with the use of >COMMON blocks and EQUIVALENCEs. You can't even begin to do some of the >data overlapping and data disection in C that Fortran enables you to do. I totally agree about the virtues of C for datatype/structure manipulation. But I cringe at the use of COMMON blocks and EQUIVALENCES in Fortran, even though I have used them to do the sorts of perverse memory handling you suggest (at least years ago). Nowadays I would say that there is little need for such things however, given the ability to do dynamic memory allocation either by linking to malloc or in Fortran 90. >Of course, I haven't mentioned anything that is news to anyone. I guess >the fact that I wouldn't want to write anything larger that a couple of >hundred lines in Fortran but don't mind writing large applications in C >says something for C. Perhaps, but are you programming numerical codes? The codes we develop average 50,000 to 100,000 lines of Fortran (probably half of that are comments however). If it is done with care, we have had minimal problems and we run the same code on everything from PC's to Crays to Connection Machines (though the CM2 does require some modification to exploit Fortran 90 array constructs). >P.S. Both the Fortran and C compilers are written in C :-) No question about that, but so? A compiler is not a numerical computation. John Prentice Amparo Corporation