From chemistry-request@ccl.net Mon Dec 9 11:13:13 1991 Date: Mon, 9 Dec 1991 10:49 EST From: Dale Southard Subject: 4th generation language for Chem. To: chemistry@ccl.net Status: R Doesn't AVS fill a lot of the void for a 4th generation language? From what I have seen of it, most of the basic tools for visualization are there, waiting to be hooked on to the computational section of the program. For those wanting to develop new computational methods, making a routine AVS compatable is easier than making it X11 compatable. Of course, the problem that arises is choosing a STANDARD. AVS seems to contain most of the necessary finctionality, but until everyone decides to work within AVS (or whatever), there is no standard. Any 4GL is only as good as the tools available within it. Systems programmers can construct nice 4GL's, but it is up to chemists to implement them. Dale From chemistry-request@ccl.net Mon Dec 9 11:46:59 1991 Date: Mon, 9 Dec 1991 11:37 EST From: Dale Southard Subject: RE: Fortran vs. C To: chemistry@ccl.net Status: R Adding fuel to the fire: The problem with Fortran when compared to C is in the maitainability of its code. Fortran programs have a tendency to degenerate into jumbles of spaghetti code. Fortran itself does not encourage the creation of structured, modular code (some would go so far as to say that it actively discourages it). This is not something new, nor is it something that will be fixed in f90. The end result is that fortran tends to force the reinvention of the wheel from one program to the next. C on the other hand (as well as modula-2, Oberion, pascal (the Wirth family?), others?) enforces the use of top-down programming techniques that yield code with a great degree of reusability. As has been mentioned before, such code can be forever after availiable to the programmer with a simple pre- processor directive if so desired. The migration to C++ brings object oriented programming into the picture -- something whose use has yet to be tapped by the scientific community.... Of course C is also everything that fortran programmers think it is ... cryptic, weakly typed, etc etc. Final decision: I don't know. C has a lot more to offer in terms of flexability and power, but fortran is definitely easier to learn. Perhaps f90 will shift the balance. Dale Southard U of Toledo From chemistry-request@ccl.net Mon Dec 9 12:48:23 1991 Date: Mon, 9 Dec 91 12:31:49 EST From: shenkin@avogadro.barnard.columbia.edu (Peter S. Shenkin) To: chemistry@ccl.net Subject: RE: Fortran vs. C Status: R > From: Dale Southard > > The problem with Fortran when compared to C is in the maitainability of its > code. > > Fortran programs have a tendency to degenerate into jumbles of spaghetti > code. Fortran itself does not encourage the creation of structured, modular > code (some would go so far as to say that it actively discourages it)... I actually wonder how much of this is in the language itself (Fortran or C), and how much is in the culture built up around the language. C does have more structured features than Fortran, it is true, but very nicely structured code can also be written in Fortran-77, especially if you accept the INCLUDE extension. The C bible is Kernighan and Ritchie, and their code is beautifully structured, indented, etc. C maniacs may fight over alternative indentation styles, but in Fortran there's more of an argument whether to indent or not in the first place! This is only a matter of culture (or the lack thereof). :-) I guess this is just a philosophical point, but maybe not. If f90 gives us wonderful tools such as modules, etc., will the Fortran culture succeed in using them to write spaghetti code? My guess is Yes! I'll take mine with the putanesca sauce.... -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@avogadro.barnard.columbia.edu shenkin@cunixc.BITNET ********** "I've got algorithm -- who could ask for anything more?" ********** From chemistry-request@ccl.net Mon Dec 9 15:40:21 1991 Date: Mon, 9 Dec 91 14:09:46 EST From: Kevin Moore To: chemistry@ccl.net Subject: CHELPG... Status: R Hello- Because of some local needs, we have optimized/vectorized the CHELPG program for the Cray Y-MP. I have done some tests of it which have duplicated previous calculations, but would like a couple of regular users of CHELPG to test it. This could be done by sending me the input, output and basis info or grabbing the code and running it on a Cray which you can access. The code is running over 25 times faster than the code I originally received. If you are interested, please contact me at kmoore@ncsc.org. Thanks. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ || Kevin Moore North Carolina Supercomputing Center || || Scientific Support Analyst 3021 Cornwallis Rd. || || (919) 248-1179 Research Triangle Park, NC 27709 || ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From chemistry-request@ccl.net Mon Dec 9 16:38:56 1991 Date: Mon, 09 Dec 1991 13:31:57 PST From: "W. Todd Wipke" To: chemistry@ccl.net Subject: Re: FORTRAN vs C Status: R I think the background of the programmer is important to consider. Most of the FORTRAN scientific programmers have lots of training in math and science, but little or none in modern programming methodology. They learn >from old FORTRAN programs that are not good examples of structured programming. C programmers started with structured programming text books and much more recent reference code. I recall when PL-1 was going to totally displace FORTRAN, it didn't. In 1978 the PRIMOS operating system for Prime timesharing computers was written in FORTRAN, and it was built with structured programming. In summary, most scientists are trained primarily in their discipline, programming is considered by many to be "obvious" if you know the math of your discipline--the program follows obviously from the matrix equations. Scientists often learn programming by looking at old programs that are usually written in FORTRAN and usually linear spaghetti style without indention. Newer applications such as AI, graphics, synthesis planning, etc show stronger influence from software engineering and minimal math. We should realize that programming is a form of creative scientific writing. We emphasize to our students the importance of writing style and clear concise writing. We should extend this to programming style, its important to the future of the field of computational chemistry. wipke@secs.ucsc.edu Todd Wipke Molecular Engineering Laboratory University of California Santa Cruz, CA 95064 From chemistry-request@ccl.net Mon Dec 9 17:41:13 1991 Date: Mon, 9 Dec 1991 17:24 EST From: Dale Southard Subject: Re: FORTRAN vs C To: chemistry@ccl.net Status: R >> From: Dale Southard >> Fortran programs have a tendency to degenerate into jumbles of spaghetti >> code. Fortran itself does not encourage the creation of structured, modular >> code (some would go so far as to say that it actively discourages it)... >From: IN%"shenkin@avogadro.barnard.columbia.edu" >I actually wonder how much of this is in the language itself (Fortran or C), >and how much is in the culture built up around the language. C does have >more structured features than Fortran, it is true, but very nicely structured >code can also be written in Fortran-77, especially if you accept the INCLUDE >extension. The C bible is Kernighan and Ritchie, and their code is >beautifully structured, indented, etc. C maniacs may fight over alternative >indentation styles, but in Fortran there's more of an argument whether >to indent or not in the first place! This is only a matter of culture >(or the lack thereof). :-) Indentation styles, though making structure easier to recognize, do NOT create structure in C. C is a wealky typed, free-form language. C code is structured no matter how it is organized/indented. Fortran is usually not structured. Structured refers to modularity of programming. In simple terms: Structured code uses functions/subroutines. Spagetti code uses the goto statement or its equilvent. To see the difference, try creating a post-test loop in fortran without a goto statement. You can't. In C it is trivial. Of course it is possible to write unstructured code in C, but it is REALLY HARD. Writing unstructured code in fortran is simple. So simple that modifications to pre-existing fortran code tend to be entropy driven (producing spagetti code). But a more interesting question: Does anyone actually have a f90 complier? I haven't seen anyone with one of these mythical beasts yet. It is getting close to '92. If fortran90 is everything it is being touted as, I would hate to see it go the way of fortran8x (i believe that the x=8 but I wasn't too involved in fortran at the time). Will f90 make the jump from ANSI standard to installed standard? Dale U of Toledo From chemistry-request@ccl.net Mon Dec 9 20:29:21 1991 Date: Mon, 9 Dec 91 19:21:33 CST From: shepard@dirac.tcg.anl.gov (Ron Shepard) To: chemistry@ccl.net Subject: Structured Programming in C and Fortran Status: R I believe that structured programming has more to do with discipline, thorough understanding of the algorithm, and programming style than with a multitute of "control structures" in a language. It is possible to write structured assembly language. I am certainly no authority, so let me appeal to one instead: from BOTH "Numerical Recipes" [in FORTRAN, page 6] and "Numerical Recipes in C" [also page 6] "We can now say what the goal of structured programming is. It is to make program control manifestly apparent in the visual presentation of the program." I don't agree entirely with this point of view in the sense that, being somewhat more practical-minded, I think the fact that well-structured codes also usually result in better object code is also important. For compilers, if not for assemblers, this has to do with the elimination of wild statement labels, the enabling of template recognition of optimization blocks, the replacement of complicated syntax analysis with simpler parsing techniques for optimization, and other mysterious aspects of compilers. Another interesting quote from the C version [page 21-22]: "The practical scientist is trying to solve tomorrow's problem with yesterday's computer; the computer scientist, we think, often has it the other way around." Although written specifically about the implicit conversion of float to double in arithmetic operations in C, this comment probably applies to several other aspects of computer languages as well. I wonder however, is it easier for a Fortran programmer to glance through "Numerical Recipes in C", or for a C programmer to glance through "Numerical Recipes", and understand what is going on? The answer, and its implication on which language is clearer, might be surprising. -ron shepard