comp.lang.ada
 help / color / mirror / Atom feed
From: Dr Adrian Wrigley <amtw@linuxchip.demon.co.uk>
Subject: Re: Numerical Computation and Ada95
Date: Thu, 10 May 2001 01:41:35 +0100
Date: 2001-05-10T01:41:35+01:00	[thread overview]
Message-ID: <3AF9E3BF.D6D73BEA@linuxchip.demon.co.uk> (raw)
In-Reply-To: 9dc4sh$ru5$1@ulysses.noc.ntua.gr

Hi,

I believe that Ada95 is well suited to numerical programs.  Although I have
only used the "77" flavor of Fortran, and prefer C to C++, the usual
advantages of Ada shine:

Legible programs, more thorough correctness checks, etc.

I would also add that Ada generics make it much easier to express the
algorithms, without being burdened by instance specific details.
If the code is algorithmicly rich, you'll get efficient, correct code
in less time than the other languages mentioned, once you know
the languages equally well. Interfacing to other language libraries
is usually straightforward, but still more work than keeping it all
in one language.  If you're just bolting together other people's
code, the pressure is always to use the same language as they do.

Another thing I have found is that writing correct multi-threaded code
is much easier with Ada95 than anything else I have used, making it
simple to take advantage of multiprocessor machines, and concurrent
computation and I/O.  This could be of relevance with large memory
problems going into swap a lot.

The issue of performance is one of my biggest worries when choosing
Ada95 over other languages, when speed is critical.  Comments elsewhere
in this thread suggest that this is not normally a problem, but I
have found that great care is needed to avoid inocuous constructs which
result in slow code.  Sometimes this prevents writing the code in
the most "natural" way.  Things may be better now with the latest
GNAT (I developed most of my performance-critical code under GNAT 3.11, 3.12).
Of course, you need to take great care in C or C++ too.  Fortran(77) seemed
to be a lot more robust in performance terms, perhaps because it was
quite limited in what you could do.  Try some simple example comparisons
in your proposed environments.  They may not be representative, but
at least you'll have some idea what to expect with "real" code.

A lot will depend on whether you can "go it alone", or whether you
need support from your colleagues, boss, customers etc., as well as
the size of project and penalty for failure.  If you are in a big
department hooked on F90, or working on a major new project for
your employer, the biggest risks may be political.  You would need
a lot of confidence, with sound justifications to introduce Ada.
The skeptics will be convinced that all the problems you encounter
are due to the use of Ada.  Usually they'll be wrong.  If you don't
have the confidence to use Ada for a project, don't try.  Go home
and familiarize yourself with the technical issues surrounding the
language on your own (Linux) machine.
--
Adrian Wrigley



  parent reply	other threads:[~2001-05-10  0:41 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
2001-05-09 21:57 ` James Rogers
2001-05-10  0:41 ` Dr Adrian Wrigley [this message]
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