Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!mips!zaphod.mps.ohio-state.edu!rpi!batcomputer!theory.TC.Cornell.EDU!riley From: riley@theory.TC.Cornell.EDU (Daniel S. Riley) Newsgroups: comp.sys.amiga.advocacy Subject: Re: Language Wars Message-ID: <1991May31.181153.584@batcomputer.tn.cornell.edu> Date: 31 May 91 18:11:53 GMT References: <1991May28.173812.4183@colorado.edu> <1258@cbmger.UUCP> Sender: news@batcomputer.tn.cornell.edu Organization: Cornell Theory Center Lines: 42 Nntp-Posting-Host: theory.tc.cornell.edu In article <1258@cbmger.UUCP> peterk@cbmger.UUCP (Peter Kittel GERMANY) writes: >In article <1991May28.173812.4183@colorado.edu> judd@wilkinson.Colorado.EDU (Xenu Galactic-Conqueror) writes: >>. Fortran is designed for high-powered scientific applications. >>Get on a Cray sometime - You are vain and silly if you intend to >>use any other language for that purpose. > >Please, can you tell me, what on earth in Fortran is "designed for >high-powered scientific applications"? I don't see any evidence for >this (you know, I also had to program Fortran back at university.) Sure. It doesn't support recursion. It assumes that subroutine arguments are not aliased. It doesn't have pointers. It doesn't have dynamic memory allocation. And so on... That probably doesn't sound like a list of features, does it? But it is, for high-powered scientific applications, because it makes it many optimizations possible that are difficult or impossible in languages like Modula or C. Fortran optimizers are among the best in the world at producing fast, reliable code. This is partly because fortran compiler writers have been at it for a long time, and there is a big premium for speed in scientific applications, but it also because the language is designed for speed. And if you're working on something so compute intensive that you need a Cray to run it, speed and correctness are everything. How awful the language you have to write the code in is secondary, as long as it is portable. Also, there are severe limits on how much a Fortran compiler can reorder expressions. Writing numeric code in C is a pain, because the C compiler is free to use algebraic identies to rearrange expressions. That means that expressions that are sensitive to the order of evaluation have to be broken into many separate expressions to force the order of evaluation. In Fortran, you can put a few parentheses in and be assured that the expression will be evaluated in the order you expect. Fortran certainly is not my favorite language, but there are reasons besides inertia why it is still the language of choice for heavy-duty numeric computation. -- -Dan Riley (riley@theory.tc.cornell.edu, cornell!batcomputer!riley) -Wilson Lab, Cornell University