comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: should I be interested in ada?
Date: 1999/02/18
Date: 1999-02-18T00:00:00+00:00	[thread overview]
Message-ID: <7aganu$qsc$1@plug.news.pipex.net> (raw)
In-Reply-To: 7afttr$7v3$1@nnrp1.dejanews.com

robert_dewar@my-dejanews.com wrote in message
<7afttr$7v3$1@nnrp1.dejanews.com>...
|In article <7afc1o$3mi$2@plug.news.pipex.net>,
|  "Nick Roberts" <Nick.Roberts@dial.pipex.com> wrote:
|> Other than this, there's nothing Fortran can do that Ada
|> cannot, and quite a few things that Ada can do better. It
|> may be, in practice, that sometimes Fortran compilers
|> can/will produce faster object code, but I think this is,
|> in every case (or almost), only a matter of practice,
|> rather than a theoretical limit.
|
|Yes of course all languages are Turing complete, so of
|course you can do anything in any language, but Fortran-90
|has many features not present in Ada. To give just one
|example, it has a much more sophisticated mechanism for
|dealing with array aggregates and array aggregate
|operations.


Maybe I could have phrased it a little more clearly. I meant there's nothing
Fortran can do that Ada cannot also do reasonably easily. Certainly, Fortran
has some convenience notations that are not so convenient in Ada. To take
Fortran's array facilities as an example, in Fortran one can put:

   real, dimension (1:10) :: x
   ...
   x = 1.0

setting all the elements of x to 1.0 (a 'broadcast scalar'), whereas in Ada
to do the same thing, you must code something like:

   X: array (1..10) of Float;
   ...
   for i in X'Range loop X(i) := 1.0; end loop;

or define a utility procedure, e.g.:

   type Vector is array (Integer range <>) of Float;
   ...
   X: Vector(1..10);
   ...
   procedure Fill (Object: in out Vector; Value: in Float) is
   begin
      for i in Object'Range loop
         Object(i) := Value;
      end loop;
   end;

and then one can simply call:

   Fill(X,1.0);

Fortran provides the handy 'where' statement, e.g.:

   where (x /= 0.0) x = 1.0/x

reciprocates all the elements of x except those which are zero. The
equivalent in Ada might be:

   for i in X'Range loop
      if X(i) /= 0.0 then X(i) := 1.0/X(i); end if;
   end loop;

Or again, defining a procedure:

   procedure Reciprocate(V: Vector) is
   begin
      for i in V'Range loop
         if V(i) /= 0.0 then V(i) := 1.0/V(i); end if;
      end loop;
   end;

and then the call:

   Reciprocate(X);

will do the trick. And so on.

I think it's probably best to leave the reader to decide whether the Ada
equivalents I have demonstrated here are likely to be an onerous burden to
the programmer or not. I believe Jean Ichbiah (leader of the team that
designed 'Green', the language that became Ada 83) once said "Ada is a very
simple language". Personally, I think Ada strikes a good balance of
sophistication where it is needed, but simplicity where it is not.

|I find it hard to believe that Nick knows Fortran-90 if
|he writes such a claim.

I'm afraid I must say that this strikes me as being a slightly
unprofessional comment. May I suggest that comments as to the lack of
knowledgeability of fellow usenet users are best made with a little greater
caution?

|It does not help Ada 95 to make bogus claims about it based
|on lack of knowledge of languages to which you are
|comparing it. After all people are always doing this to
|Ada, don't make the same mistake!

Certainly true. I will endeavour not to make bogus claims, and hope that
others will make a similar effort.


-------------------------------------
Nick Roberts

'The time has come,' the Walrus said,
  'To talk of many things:
Of shoes--of ships--and sealing wax--
  Of cabbages--and kings--
And why the sea is boiling hot--
  And whether pigs have wings.'
                        Lewis Carroll
          "Through the Looking Glass"
-------------------------------------








  reply	other threads:[~1999-02-18  0:00 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-14  0:00 should I be interested in ada? Phillip Helbig
1999-02-15  0:00 ` Marin David Condic
1999-02-23  0:00   ` David Starner
1999-02-15  0:00 ` Gautier
1999-02-16  0:00 ` Ken Thomas
1999-02-17  0:00   ` Nick Roberts
1999-02-18  0:00     ` robert_dewar
1999-02-18  0:00       ` Nick Roberts [this message]
1999-02-18  0:00         ` William Clodius
1999-02-18  0:00           ` robert_dewar
1999-02-19  0:00             ` William Clodius
1999-02-19  0:00               ` Nick Roberts
1999-02-20  0:00                 ` robert_dewar
1999-02-22  0:00                   ` Nick Roberts
1999-02-22  0:00                     ` William Clodius
1999-02-23  0:00                     ` robert_dewar
1999-02-23  0:00                       ` Nick Roberts
1999-02-22  0:00                 ` William Clodius
1999-02-23  0:00                   ` Nick Roberts
1999-02-23  0:00                     ` William Clodius
1999-02-25  0:00                       ` Nick Roberts
1999-02-25  0:00                         ` robert_dewar
1999-02-23  0:00               ` Robert I. Eachus
1999-02-24  0:00                 ` Nick Roberts
1999-02-26  0:00                   ` Robert A Duff
1999-02-27  0:00                     ` Semantic info pragmas (was: should I be interested in ada?) Nick Roberts
1999-03-01  0:00                       ` Samuel Tardieu
1999-03-01  0:00                         ` Robert A Duff
1999-02-24  0:00                 ` should I be interested in ada? William Clodius
1999-02-24  0:00               ` William Clodius
1999-02-25  0:00                 ` Nick Roberts
1999-02-25  0:00                   ` robert_dewar
1999-02-26  0:00                     ` Nick Roberts
1999-02-18  0:00           ` nabbasi
1999-02-18  0:00             ` robert_dewar
1999-02-18  0:00         ` Jerry Petrey
1999-02-18  0:00           ` fraser
1999-02-19  0:00             ` Matthew Heaney
1999-02-20  0:00               ` fraser
1999-02-18  0:00           ` Nick Roberts
1999-02-18  0:00             ` Joel Seidman
1999-02-18  0:00             ` Dan Nagle
1999-02-18  0:00               ` nabbasi
1999-02-19  0:00               ` Nick Roberts
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00                   ` Nick Roberts
1999-02-19  0:00                     ` William Clodius
1999-02-20  0:00                       ` Nick Roberts
1999-02-21  0:00                         ` robert_dewar
1999-02-21  0:00                           ` William Clodius
1999-02-22  0:00                           ` Nick Roberts
1999-02-19  0:00                     ` robert_dewar
1999-02-21  0:00                       ` William Clodius
1999-02-23  0:00                         ` Robert I. Eachus
1999-02-19  0:00                 ` Dan Nagle
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                     ` Nick Roberts
1999-02-19  0:00                     ` Dan Nagle
1999-02-23  0:00                     ` Peter Hermann
1999-02-18  0:00         ` robert_dewar
1999-02-19  0:00           ` Nick Roberts
1999-02-19  0:00             ` robert_dewar
1999-02-19  0:00               ` dennison
1999-02-19  0:00                 ` William Clodius
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00                 ` Nick Roberts
1999-02-20  0:00                   ` robert_dewar
1999-02-22  0:00                     ` Nick Roberts
1999-02-19  0:00               ` Phillip Helbig
1999-02-19  0:00               ` William Clodius
1999-02-19  0:00               ` Nick Roberts
1999-02-20  0:00                 ` robert_dewar
1999-02-22  0:00                   ` Nick Roberts
1999-02-23  0:00                     ` Robert I. Eachus
1999-02-24  0:00                       ` White rabbit (was: should I be interested in ada?) dennison
1999-02-25  0:00                       ` Alice books " JP Thornley
1999-02-25  0:00                         ` Robert I. Eachus
1999-02-22  0:00                   ` should I be interested in ada? dennison
1999-02-20  0:00                 ` robert_dewar
1999-02-20  0:00                   ` Steve Doiel
1999-02-18  0:00     ` robert_dewar
1999-02-18  0:00       ` Nick Roberts
1999-02-18  0:00         ` William Clodius
1999-02-18  0:00           ` dennison
1999-02-20  0:00 ` Hartmut H. Schaefer
1999-02-20  0:00   ` bill
1999-02-21  0:00     ` dewar
1999-02-21  0:00   ` dewar
1999-02-22  0:00     ` dennison
replies disabled

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