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=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,90c3c79963d78580 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-09 12:43:48 PST Path: newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <9dc4sh$ru5$1@ulysses.noc.ntua.gr> Subject: Re: Numerical Computation and Ada95 Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Wed, 09 May 2001 15:43:05 EDT Organization: http://www.newsranger.com Date: Wed, 09 May 2001 19:43:05 GMT Xref: newsfeed.google.com comp.lang.ada:7404 Date: 2001-05-09T19:43:05+00:00 List-Id: In article <9dc4sh$ru5$1@ulysses.noc.ntua.gr>, N&J says... >I have posed the question whether Ada95 is suitable for numerical >programming at the newsgroup of numerical analysis. >I asked if Ada95 is better that Fortran90/95 and C++ for writing programs >for numerical computation and the reply was that the Ada language >specification requires extensive >run-time checks which slows down the programs. I thought it would be better >to ask your opinion too. I have noticed that there are too few numerical >programs in Ada95 for numerical computation is the above fact the real cause >for this? Finally would you suggest someone to use Ada95 for numerical code? This has been asked many times before. You might have been better served by doing a groups.google.com search on it. The basic conclusions were generally: o Compilers vary so much in the quality of their optimization (even within the same language) that it really doesn't make sense to talk about relative speeds of different compiled languages. o There is nothing about Ada that makes it inherently slower than any other language. o Theoreticly, one ought to be able to get *better* optimization out of Ada than Fortran or C for the same effort, as all the rules and limitations of Ada language give the compiler a lot more information to work with. o Fortran users tend to care a lot more about number-crunching speed than other language users, so their compilers generally optimize that stuff better. o In real-world terms none of this hypothetical stuff matters. What you need to do is compare the speed of the code generated by the compilers you are considering, for the kinds of operations you are going to be performing. Even here you have to be careful, as its easy for a neophyte in any langugage to stumble over a construction that is needlessly difficult for their compiler to optimize. Just to give an example, the Aonix Ada compiler for NT doesn't provide *any* optimization options whatsover (at least it didn't last I used it). The Gnat Ada compiler provides the typical "-On" where n is in 0..3, along with some others. The x86 vxWorks GreenHills compiler we use here for real-time work provides flags for all sorts of arcane optimization options. Now it would be quite easy for someone to compare what the Aonix compiler does with an algorithm to what a serious numerical Fortran compiler does, but it wouldn't exactly be a fair comparison. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com