From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail From: Brooks Moses Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Ada vs Fortran for scientific applications Date: Sun, 21 May 2006 23:45:01 -0700 Organization: Stanford University Message-ID: <44715DED.5050906@cits1.stanford.edu> References: NNTP-Posting-Host: dnab42a52e.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.Stanford.EDU 1148280312 27182 171.66.165.46 (22 May 2006 06:45:12 GMT) X-Complaints-To: news@news.stanford.edu User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news2.google.com comp.lang.ada:4324 comp.lang.fortran:10053 Date: 2006-05-21T23:45:01-07:00 List-Id: Nasser Abbasi wrote: > I like to discuss the technical reasons why Ada is not used as much as > Fortran for scientific and number crunching type applications? > > To make the discussion more focused, let's assume you want to start > developing a large scientific application in the domain where Fortran is > commonly used. Say you want to develop a new large Finite Elements Methods > program or large computational physics simulation system. Assume you can > choose either Ada or Fortran. > > What are the technical language specific reasons why Fortran would be > selected over Ada? In my case? I know Fortran. I don't know Ada. I would be foolish to attempt to learn a new language while writing a large program that I needed to rely on. > I happened to know a little about Ada and Fortran, and from what I know, I > think Ada would be an excellent choice due to its strong typing, good > support for numerical types and good Math library. Quite probably. Many languages are. I'm rapidly becoming of the opinion that, once languages hit a minimum level of functionality sufficient to be capable of solving the problem at hand -- and, for scientific processing, that generally means "does it avoid doing something stupid with basic array math?" and "can it link to an appropriate parallel-processing library" -- the relevant questions are all about the available programmers and the character of the interface between the programmer and the language. Some languages are vastly easier to program in than others -- but which one is which depends on the programmers you have and what they're trying to do. > I know also that Fortran is supposed to be better/faster when it comes to > working with large Arrays (Matrices), but it is not clear to me why that is, > and if it is still true with Ada 05. Something about arrays aliasing, but > not sure how that is. This may be true to a minor extent; I doubt that there is any major fundamental difference. In general, "Which language is faster?" is a meaningless question. To take a well-populated example, consider that for Fortran on Intel desktop computers there are usually significant variations (10 to 20 percent seems very common) in the speed of the exact same program when compiled on different compilers -- and that's just the mature compilers. With less-mature compilers, such as early versions of g95 and gfortran, there can be differences of a factor of two or three in speed. Now, it is highly unlikely that the Ada language has anything in it that will cause more than a few percentage points of difference in the maximum theoretically-achievable speed. Thus, in practice any speed differences are going to be almost entirely a factor of the quality of the code you write, and the quality of the compiler you compile it on. The only way the language is likely to be relevant is if you are writing the code for a platform where there aren't any high-quality compilers for the language you're using. My completely unfounded guess is that this is more likely to be true for Ada than it is for Fortran, simply because of popularity, but it could be completely the reverse for the system you're using. Thus, it's far more important to look at the compilers you have available, and do your own tests on comparable code similar to your expected application, than it is to worry about minor theoretical details about "which language is faster". > I am also not sure on the support of sparse matrices in both languages' > libraries. I'd be fairly surprised if there weren't decent sparse matrix libraries available for both languages. Probably lots of them, with a vast range of quality. > It is known that Ada strong domain is realtime and safety critical > applications. I never understood why Ada never became popular in the > scientific field in particular in areas such as computational physics or CFD > or such similar fields. I have no idea; by the time I reached college, that popularity contest had already been settled, and my intro-to-engineering class taught Fortran and didn't teach Ada. - Brooks, posting from comp.lang.fortran -- The "bmoses-nospam" address is valid; no unmunging needed.