Path: utzoo!attcan!telly!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!yale!venus!tang From: tang@venus.ycc.yale.edu Newsgroups: comp.lang.fortran Subject: Re: Fortran vs. C for numerical work Message-ID: <649.275140d0@venus.ycc.yale.edu> Date: 26 Nov 90 21:20:32 GMT Organization: Yale Computer Center (YCC) Lines: 71 Kjartan wrote that > 1. Computers are getting more and more powerful, and the importance > of speed is decreasing, i.e today on a SUN Sparcstation or an IBM Risc 6000 you can get computational power, that some years ago was only > available, on larger mainframes, using batch. > > This idea of batch job, compared to interaction on a workstation, is > very important, when we say that the importance of speed is decreasing. > When you run a job in batch on a CRAY 2 computer, you will get your > result in a time scale ranging from a few hours to a few days, even though the actual job only takes a few minutes in running. If instead > you write a program which runs *interactively* on a workstation on > your desktop, you actually see what is happening and you can change > the parameters of the system accordingly, immediatly. > Excuse me if my exposure to numerical computations is limited. It seems that the demand for speed is never satisfied. It may be true that some of the yesterdays problems could be solved quite readily on platforms such as Spacstations or even PC's. However, researchers never ceased to ask for more. Typical examples are higher resolution (more grid points, etc), better physical representations which inevitably require more computation. For those who are devoted to pushing the frontiers of numerical computation, they are more willing to spend efforts on the physics rather than on the langugauge since a language is only a tool, it is incapable of yielding new ideas, but physics is a "living species". I agree completely that for teaching college students, interactive programs are "better" than programs which run in batch mode, but what difference does it make if a program takes a few hours of run time on a Cray? You will be bored to death just to sit in front of a terminal. > 2. Another reason is the concept of abstraction. A language such as > C++ (and C if you are careful) offers the possibility of creating > more abstract data types and operation, which are more adapted to > the theory in which you work. This makes a bridge between the theorists > and the pure and hard numerics. There was a time, when there was a > clear distinction between those who formulated the problems and those > who actually implemented them on the computers. This distinction is > very bad, and can lead to many kinds of frictions. With the evolution > of computer science, the aim should be, that anybody who wants to use > the power of a computer to solve a problem should be able to do it without being an expert in the byte ordering of a given machine, or god knows what. > The way I perceive languages is that all languages are more-or-less the same. They differ in the way they alter the thinking of a programmer. The reasoning I offer is that a program must be compiled into machine code, at which point the identity of the original high-level langugaue is lost. An array in Fortran or a pointer in c is translated into machine code. In fact, I witnessed a case in which a piece of Fortran code was so well written that it was just as good as its assembler equivalence, even though it is commonly assumed that codes written in assembler are faster. Hence, the goodness or badness of a language is therefore compiler dependent. But I would like to make one more comment. As pointed out by other defenders of Fortran, Fortran does not have a steep initial learning curve as opposed to c as far as numerical computation is concerned. It seems that many c programmers have suffered so much that they want the rest of the world to share it. > > In short: Fortran was a language designed to make calculations in > batch on some large mainframe, and is not adapted to be on your desktop. > > The C language was not actually designed either to be on your desktop, > but the evolution has been that it is there, and that it works well > with UNIX, and works well with X11, the standard in networked graphics and interactive applications. > > Computers are changing, and languages must change also. > It is horrible to imagine that one day in the future UNIX was no longer the favorable operating system, what language would c-programmers be using then? Tang