comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: Where is the elusive jump command?
Date: 2000/04/02
Date: 2000-04-02T01:03:15+00:00	[thread overview]
Message-ID: <8c668j$hv0$1@slb1.atl.mindspring.net> (raw)
In-Reply-To: wcc66u1g5ej.fsf@world.std.com

In article <wcc66u1g5ej.fsf@world.std.com>,
	Robert A Duff <bobduff@world.std.com> wrote:

>Richard D Riehle <laoXhai@ix.netcom.com> writes:
>
>> This could have been accomplished without the word _aliased_
>> keyword.  Could it have been as easily checked by the compiler?
>
>Yes, because as Robert pointed out, the same analysis has to be done for
>'Address, anyway.

OK.  So the same analysis must be done.  That does not change the
value of _aliased_ for the programmer writing the code.  Knuth, as
mentioned earlier, suggests that programming languages are designer
for humans not for compilers.  Ada is somewhere in between, I guess
because many of the rules in the language are intended to enable the
construction of more robust compilers.

Also, I recall reading somewhere, perhaps the Rationale, that aliased
was intended to be useful for the compiler writer so code optimizations
could be anticipated.  Perhaps this usage is now superseded by more
clever compiler designs.

>> It seems to me that _aliased_ helps prevent the very kind of
>> errors one encounters in C.   If the reserved word is not intended
>> to provide special information to the compiler, why not just do
>> this the same way we do it in C?
>
>Umm.  Because the compiler isn't the one putting errors in the code --
>it's you and me.

Exactly my point.  And _aliased_ helps the compiler notice the errors 
we so generously contribute to the code. 

>"Aliased" is there for the human reader.  It doesn't make the compiler
>any simpler.  In fact the compiler has to go to extra trouble to check
>the rules.

Bingo. Once again, right to the original point.  That is what Ada is
about, checking to ensure we have not violated some little rule.  The
question then, "Is this an unnecessary rule?"  Should we simply let the
compiler assume we are doing what we intended?  

>>...The fact is that I cannot use
>> 'Access on a value that is not aliased.   The compiler prevents it.
>> Hence, I see this is as a signal to the compiler that I am trying
>> to do something illegal.  It is also a tip-off to the compiler that
>> accessibility rules need to be enforced.  
>
>Not really -- the accessibility rules are triggered by 'Access and type
>conversions and so forth; the compiler doesn't need any "tipping off" in
>this sense.

OK.  Granted that the accessibility rules are larger than the _aliased_
keyword.  From the viewpoint of an applications developer, it seems 
that the _aliased_ keyword is essential.  Very few of us, thankfully,
are still writing compilers, so most of us look at this from the viewpoint
of human beings trying to make code work.  In fact, most of us don't care
a whit about what it takes for the compiler to do its work.  We simply
want the rules applied correctly and consistently.

>> Whatever the original intent of _aliased_ , it has the effect of 
>> letting the programmer know about the legality or illegality of a
>> syntactic construct, ensuring that certain practices are avoided,
>> and making it clear what one's intentions are in the source code.
>
>Right.

Glad we can agree on this.  From my perspective, this is an essential
idea.  My sentence, with which you seem to agree, probably applies to
lots of other syntactic constructs in the language.  Question: would
the Ada language be just as effective without the _aliased_ keyword?
Are there other keywords we could jettison in favor of simplicity? 

>>...Perhaps requiring the reserved word _aliased_ encourages the
>> sparing use of it in source code.
>
>I've heard that sort of thing many times.  I don't agree.  A competent
>programmer will use '[Unchecked_]Access on local variables exactly when
>appropriate -- no more, no less.  That's true whether or not you have to
>mark things as "aliased".  The point (IMHO) is not to encourage or
>discourage things, but to make sure the *reader* of the code can easily
>see what's going on.

That makes very good sense.  It takes us back to the issue of interaction
between programmer and compiler, where the language is designed to 
improve clarity for the human reader of source code, not just for the
compiler.  This is in keeping with the spirit of Don Knuth's "Literate
Programming," admonitions.  It is also in compliance with what many of
us see as the underlying goal of Ada:  maximize the amount of checking
a compiler can do as early in the development process as possible.  That
checking includes pummeling the programmer about the  head and shoulders
soundly for forgetting to include the _aliased_ keyword.  

Richard Riehle


 




  reply	other threads:[~2000-04-02  0:00 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-21  0:00 Where is the elusive jump command? dis90072
2000-03-21  0:00 ` Stanley R. Allen
2000-03-21  0:00 ` Nicolas Brunot
2000-03-21  0:00 ` Nicolas Brunot
2000-03-27  0:00 ` Robert A Duff
2000-03-28  0:00   ` Dale Stanbrough
2000-03-28  0:00   ` Ken Garlington
2000-03-28  0:00     ` Robert Dewar
2000-03-28  0:00       ` Ken Garlington
2000-03-28  0:00         ` Marin D. Condic
2000-03-28  0:00           ` Robert Dewar
2000-03-29  0:00             ` Marin D. Condic
2000-03-29  0:00               ` Gary Scott
2000-03-29  0:00                 ` Robert Dewar
2000-03-30  0:00                   ` David Starner
2000-03-30  0:00                     ` Marin D. Condic
2000-03-30  0:00                       ` Gary Scott
2000-03-31  0:00                         ` Tarjei T. Jensen
2000-03-31  0:00                           ` Larry Kilgallen
2000-03-31  0:00                             ` Gary Scott
2000-03-30  0:00                       ` Samuel T. Harris
2000-03-30  0:00                       ` Dan Nagle
2000-03-30  0:00                         ` Samuel T. Harris
2000-03-31  0:00                           ` Gisle S�lensminde
2000-03-30  0:00                         ` David Starner
2000-03-30  0:00                       ` Larry Kilgallen
2000-03-31  0:00                       ` Tarjei T. Jensen
2000-04-12  0:00                         ` Robert A Duff
2000-04-12  0:00                           ` Stanley R. Allen
2000-04-12  0:00                             ` Samuel T. Harris
2000-04-13  0:00                               ` Stanley R. Allen
2000-04-14  0:00                                 ` Samuel T. Harris
2000-04-14  0:00                                   ` BASIC->Ada, was " tmoran
2000-04-15  0:00                                 ` Robert Dewar
2000-04-15  0:00                             ` Robert Dewar
2000-04-13  0:00                           ` Tarjei T. Jensen
2000-03-31  0:00                       ` Gisle S�lensminde
2000-03-31  0:00                       ` Gautier
2000-03-30  0:00                   ` Gautier
2000-03-30  0:00                     ` Gary Scott
2000-03-30  0:00                       ` David Starner
2000-03-30  0:00                         ` William B. Clodius
2000-03-30  0:00                       ` Gautier
2000-03-30  0:00                   ` Gary Scott
2000-03-30  0:00               ` Alfred Hilscher
2000-03-29  0:00             ` Richard D Riehle
2000-03-29  0:00               ` Robert Dewar
2000-03-30  0:00                 ` Richard D Riehle
2000-04-01  0:00                   ` Robert A Duff
2000-04-02  0:00                     ` Richard D Riehle [this message]
2000-04-02  0:00                       ` Robert Dewar
2000-04-02  0:00                       ` Robert Dewar
2000-04-02  0:00                     ` Robert Dewar
2000-03-30  0:00                 ` Alfred Hilscher
2000-04-01  0:00                   ` Robert Dewar
2000-04-04  0:00                     ` Alfred Hilscher
2000-04-05  0:00                     ` Ole-Hjalmar Kristensen
2000-04-05  0:00                       ` Larry Kilgallen
2000-04-06  0:00                         ` Ole-Hjalmar Kristensen
2000-04-06  0:00                           ` OS Bindings (was: Where is the elusive jump command?) Larry Kilgallen
2000-04-06  0:00                             ` Ole-Hjalmar Kristensen
2000-04-06  0:00                             ` Robert Dewar
2000-04-07  0:00                               ` Tarjei T. Jensen
2000-04-09  0:00                                 ` Robert Dewar
2000-04-10  0:00                                   ` Tarjei T. Jensen
2000-04-12  0:00                                     ` Robert Dewar
2000-04-12  0:00                                       ` Tarjei T. Jensen
2000-04-12  0:00                                         ` Robert Dewar
2000-04-13  0:00                                           ` Tarjei T. Jensen
2000-04-15  0:00                                             ` Robert Dewar
2000-04-15  0:00                                               ` Tarjei T. Jensen
2000-04-12  0:00                                       ` Robert A Duff
2000-04-12  0:00                                         ` Tarjei T. Jensen
2000-04-12  0:00                                           ` Robert A Duff
2000-04-12  0:00                                             ` Robert Dewar
2000-04-12  0:00                                               ` Robert A Duff
2000-04-15  0:00                                                 ` Robert Dewar
2000-04-15  0:00                                                 ` Robert Dewar
2000-04-15  0:00                                                   ` Gisle S�lensminde
2000-04-13  0:00                                               ` Tarjei T. Jensen
2000-04-13  0:00                                                 ` Gisle S�lensminde
2000-04-12  0:00                                             ` Florian Weimer
2000-04-13  0:00                                             ` Tarjei T. Jensen
2000-04-13  0:00                                               ` Robert A Duff
2000-04-18  0:00                                                 ` Tarjei T. Jensen
2000-04-15  0:00                                               ` Robert Dewar
2000-04-15  0:00                                                 ` Tarjei T. Jensen
2000-04-12  0:00                                           ` Robert Dewar
2000-04-12  0:00                                           ` Robert Dewar
     [not found]                             ` <eisner comp.lang.ada:53670>
2000-04-06  0:00                               ` Larry Kilgallen
2000-04-06  0:00                                 ` Robert Dewar
2000-04-08  0:00                                   ` nickerson
2000-04-09  0:00                                     ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2000-03-21  0:00 Where is the elusive jump command? dis90072
2000-03-21  0:00 ` Preben Randhol
2000-03-30  0:00   ` Alfred Hilscher
replies disabled

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