comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: Numerical Computation and Ada95
Date: Wed, 09 May 2001 19:43:05 GMT
Date: 2001-05-09T19:43:05+00:00	[thread overview]
Message-ID: <d5hK6.8194$vg1.682538@www.newsranger.com> (raw)
In-Reply-To: 9dc4sh$ru5$1@ulysses.noc.ntua.gr

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



  parent reply	other threads:[~2001-05-09 19:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-09 19:13 Numerical Computation and Ada95 N&J
2001-05-09 19:42 ` David Starner
2001-05-10 12:23   ` Pat Rogers
2001-05-10 13:51   ` Ted Dennison
2001-05-10 18:21   ` Jeffrey Carter
2001-05-09 19:43 ` Ted Dennison [this message]
2001-05-09 21:57 ` James Rogers
2001-05-10  0:41 ` Dr Adrian Wrigley
2001-05-10  5:45   ` N&J
2001-05-10  6:37     ` David Starner
2001-05-10  6:48     ` tmoran
2001-05-10 20:12       ` Gary Scott
2001-05-10 14:04     ` Ted Dennison
2001-05-11 14:15       ` Marin David Condic
2001-05-10 20:08     ` Gary Scott
2001-05-11 11:58       ` Larry Kilgallen
2001-05-11 11:31         ` Dan Nagle
2001-05-11 14:33         ` Gary Scott
2001-05-11  4:00     ` Lao Xiao Hai
2001-05-11 14:03     ` Marin David Condic
2001-05-10  8:00 ` Martin Dowie
2001-05-10 14:11   ` Ted Dennison
2001-05-10 15:46     ` Martin Dowie
2001-05-10 13:54 ` Martin Stift
2001-05-11  5:59   ` mike
2001-05-10 19:07 ` Laurent Guerby
2001-05-10 20:49 ` N&J
2001-05-11 16:28   ` Jean-Pierre Rosen
2001-05-11 18:28     ` Marin David Condic
2001-05-13 21:42   ` Gautier de Montmollin
2001-05-11  2:02 ` DuckE
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox