Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!sim.Berkeley.EDU!hshankar From: hshankar@sim.Berkeley.EDU (RAMACHANDRAN HARISHANKAR) Newsgroups: comp.lang.fortran Subject: [long]Re: modules in f8x Message-ID: <1456@pasteur.Berkeley.Edu> Date: 12 Mar 88 09:30:35 GMT References: <9872@steinmetz.steinmetz.UUCP> <1178@ut-emx.UUCP> Sender: news@pasteur.Berkeley.Edu Reply-To: hshankar@sim.Berkeley.EDU.UUCP (RAMACHANDRAN HARISHANKAR) Organization: University of California, Berkeley Lines: 45 Keywords: fortran,f8x,typing Summary: strong typing needed I must disagree that the strong typing available in pascal and c and ada is sufficient for fortran users. First, I have never found the need for structures in my numerical programming. The data structures are simply not that complex. So adding that feature simply complicates life for insufficient reason. Second the kind of strong typing available in pascal does not handle tensors and units. In the example given if we defined variables with appropriate types, pascal would still not allow us to check for that error. In one of my programs I had a large number of multidimensional arrays, with nearly all dimensions that same , but with very specific physical meaning. So it was alright to contract the 2nd row of A with the 3rd column of B, but not with the 4th column, even though the dimensions agreed. The resulting mess took me months to work out, and I finally did so by the use of a precompiler that enforced my strong typing for me. So fortran DOES need strong typing, and it needs a version of it that is quite different from pascal and c. A more general example is the need to distinguish covarient and contravarient indices in a tensor. Both are indices going from 1 to 4. But never should we allow covarient to contract with covarient and vv. I do not know of an algorithm that will allow fortran to enforce this, but I do know that pascal does not. [I learnt the language for that purpose and found it unsuitable] Third, pascal and c compilers lack the complex type, and most of my programming is in the complex plane. Fourth, invisible coddling by a language is VERY beneficial to those of us who are not master programmers. When I program I use all sorts of horrible constructs, knowing that if it is wrong the compiler will catch me out. I don't make a career of programming. It is just a tool to use in doing research. So I expect to find safeguards to protect me from myself. I believe that a very large number of scientists are in the same boat. In short, I don't care about structured constants and typedefs and things like that, but DO care to have the ability to associate units with dimensions. That is a very important and useful capability. Many mathematical aids now a days have this ability, and it is there because physicists think better in terms of conceptual formulae than in terms of computerese. hari ramachandran.