comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Integer'Size < 32 ?
Date: 1996/08/12
Date: 1996-08-12T00:00:00+00:00	[thread overview]
Message-ID: <dewar.839854589@schonberg> (raw)
In-Reply-To: 4ulinr$a7q@wdl1.wdl.lmco.com


Mark said

"At minimum this is bad quality of implementation, for an Ada 95 compiler this
appears to a compiler bug.  Ada 95 basically used a duck* test for static
expression and requires that they be evaluated at compile time even when they
don't appear in a static context."

Mark's description of the Ada 95 situation is both picturesque and
accurate :-)

By comparison in Ada 83, static expressions were only those that appeared
in syntactic positions requiring static expressions, or perhaps more
accurately, let us say that the exact evaluation rules applied only in
such circumstances.

It is quite unfair to say that what DEC did in Ada 83 was bad quality
implementation. It was quite deliberate. When you are faced with an
implementation dependent feature where you have the choice of accepting
more or fewer valid programs, then you can take one of two attitudes:

1. Accept as much as possible: "Ada code everywhere will port easily to my
   compiler."

2. Accept as little as possible: "Ada code developed on my compiler will
   port easily to other compilers."

Either goal is valid, and without adding zillions of switches to the
compiler you cannot satisfy both (besides satisfying both may add
unacceptable complexity to the compiler).

One situation like this is the choice of elaboration orders. Some compilers
are very friendly in choosing a "good" order of elaboration without the
need for what really are required Elaborate pragmas. Fine, but in practice
that encourages people to write implementation dependent non-portable
programs and they have trouble when they port to other implementations.

Intermetrics has, I believe a switch for this particular case, which seems
like a good idea, basically the settings are choose a good order (one most
likely to succeed), and choose a bad order (one most likely to fail).





      reply	other threads:[~1996-08-12  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-08  0:00 Integer'Size < 32 ? W. Wesley Groleau (Wes)
1996-08-09  0:00 ` Robert A Duff
1996-08-10  0:00 ` Robert Dewar
1996-08-11  0:00 ` Mark A Biggar
1996-08-12  0:00   ` Robert Dewar [this message]
replies disabled

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