Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!cunixf.cc.columbia.edu!shenkin From: shenkin@cunixf.cc.columbia.edu (Peter S. Shenkin) Newsgroups: comp.lang.fortran Subject: Re: Missing the whole point (the Fortran vs. C debate) Message-ID: <1990Dec2.174007.4921@cunixf.cc.columbia.edu> Date: 2 Dec 90 17:40:07 GMT References: <28548@usc> Organization: Columbia University Lines: 70 In article <28548@usc> ajayshah@almaak.usc.edu (Ajay Shah) writes: >The essential reason why I get repelled fortran, dusty decks >in fortran and the mindset of traditional (read: went to graduate >school before 1975) fortran programmers is the terrible >look-and-feel... > >.... I've seen >single-file-programs in fortran written two years ago (not the >dark ages of the 60s) of 10000 lines! (not more than a few >hundred lines of comments, obviously). That is disastrous, and >that is the essence of the problem to me. Well, if that's the essence of the problem, you might as well give up now. If you could convince these same guys (who are probably brilliant engineers and applied mathematicians) to write in C, I would put money on the proposition that their C code would look like their Fortran code. Admittedly, C has a tradition of structured coding (my, how old-fashioned that word sounds these days), whereas Fortran does not, but structured programming can be done in Fortran, and my guess is that most contributors to this newsgroup program this way. Here's *my* idea of what the essence of the problem is. I would like to phrase it as a followup to the following dialog, which appeared earlier in the discussion. I had written: >>... the above observations would seem to imply that if the programmer >>simply restricts him/herself to a Fortran-like "highly optimizable subset" >>of C, then he/she can expect Fortran-like performance out of any reasonably >>good C compiler. gwyn@smoke.brl.mil (Doug Gwyn) replied: >It doesn't matter whether that is true or not; such crippled programming >would negate much of the advantage of using C in the first place. Use >the right tool for the job and stop worrying about code optimization! First, I think my idea -- that there might be a "highly optimizable subset" of C which would give code that runs as fast as Fortran code given current compiler technology -- has been amply refuted in the subsequent discussion; so I'm no longer proposing that. But in response to Doug's comment, I can cite my own experience as follows. I wrote a package a few years ago that spent 90% of its time doing numerically intensive calculations, which is where Fortran excels. However, the code that coded the numerical functionality only constituted about 10% of the program. Most of the program involved interacting with the user, doing book-keeping on the internal data structures and on the state of the program, parsing user commands, issuing reports, doing io, and so on. Now, I found C much more suitable for this 90% of the code, and when it came down to the other 10%, which is where the program spends most of its time, I said, "Hell, I'll just do that in C, too." My alternatives were (1) write the whole thing in Fortran, or (2) write just the numerical part in Fortran, or (for completeness only -- not seriously considered!) (3) use some other language or combination of languages. Any of these possibilities would have been possible, but under the circumstances I took the path of least resistance, while still wishing I could have had my cake and eaten it too. So what this whole discussion is really about, for me, is, "Isn't there, or at least couldn't there, be a way for me to have my cake and eat it, too," or at least to simultaneously have and eat a larger fraction of it than is now possible. Now, I realize, some would answer, "Yes, the answer is Fortran90," and some might answer "Yes, do inter-language procedural calls," and some might answer "Yes, just get people to put conformant arrays and noalias into C," but whatever the answer is, this is the question, for me. -P. ************************f*u*cn*rd*ths*u*cn*gt*a*gd*jb************************** Peter S. Shenkin, Department of Chemistry, Barnard College, New York, NY 10027 (212)854-1418 shenkin@cunixf.cc.columbia.edu(Internet) shenkin@cunixf(Bitnet) ***"In scenic New York... where the third world is only a subway ride away."*** Brought to you by Super Global Mega Corp .com