comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: seperate keyword and seperate compilation with Gnat?
Date: 1996/07/09
Date: 1996-07-09T00:00:00+00:00	[thread overview]
Message-ID: <DuA43q.CtC@world.std.com> (raw)
In-Reply-To: 4rrcal$hhh@newsbf02.news.aol.com


In article <4rrcal$hhh@newsbf02.news.aol.com>,
John Herro <johnherro@aol.com> wrote:
>this case, Janus/Ada has a pragma for the user to tell the compiler that
>the program will *not* use 'Image or 'Value for a particular enumeration
>type.

Ada 95 has a similar feature -- see pragma Discard_Names.  It also works
for eliminating tag names for tagged types.

>...  How about a pragma or compiler switch
>to tell Gnat that the whole program won't use tasking?

Ada 95 has this feature too -- see pragma Restrictions.  There are many
restrictions, including No_Tasks (or something like that).  Also,
implementations can add their own restrictions.

>     My philosophy is this: Ada is a large language with many features. 
>When the user specifies no pragmas or special switches, don't worry too
>much about efficiency, just compile the code quickly (without unnecessary
>recompilation) to support rapid development.  When efficiency is a
>concern, transfer *some* of the responsibility to the programmer, who can
>tell the compiler if the program won't contain tasking or use other Ada
>features that are costly in the generated code.

In general, I agree with this principle.  One can look at many
optimizations as consisting of (1) determine whether the optimization is
correct, (2) determine whether it's worthwhile, and (3) doing it.  Parts
(1) and (3) can be very error-prone, so should usually be done by the
compiler (when possible).  Part (2) is less error-prone, so it's OK to
let the user do that part, if it's hard for the compiler but not so hard
for the user.  Pragma Inline is a good example -- the user says when it
should be done, but the compiler takes care of doing it.  If the user
had to do the inlining by hand, it would be a disaster.

I was against the inclusion of pragma Discard_Names, though -- I thought
compilers ought to be able to do that optimization without the extra
hint, and I didn't think this particular feature was worth the trouble.
On the other hand, I was in favor of pragma Restrictions.

Note that pragma Restrictions is not just for optimization.  For
example, it can be helpful in proving various properties of programs --
hence the restrictions in the Safety annex.

- Bob




  parent reply	other threads:[~1996-07-09  0:00 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-02  0:00 seperate keyword and seperate compilation with Gnat? David Morton
1996-07-02  0:00 ` Samuel Mize
1996-07-03  0:00   ` Robert Dewar
1996-07-03  0:00   ` *separate* keyword and *separate* " David Morton
1996-07-03  0:00     ` Robert Dewar
1996-07-17  0:00   ` seperate keyword and seperate " Robert I. Eachus
1996-07-02  0:00 ` Peter Hermann
1996-07-02  0:00   ` David Morton
1996-07-02  0:00 ` Robert Dewar
1996-07-18  0:00   ` Peter Hermann
1996-07-20  0:00     ` Robert Dewar
1996-07-03  0:00 ` Mike Card (x3022)
1996-07-03  0:00 ` Rob Kirkbride
1996-07-03  0:00   ` Robert A Duff
1996-07-03  0:00   ` Robert Dewar
1996-07-08  0:00     ` michael
1996-07-08  0:00       ` Robert Dewar
1996-07-11  0:00         ` Robert A Duff
1996-07-11  0:00           ` Robert Dewar
1996-07-12  0:00             ` David Morton
1996-07-12  0:00               ` Robert Dewar
1996-07-16  0:00                 ` Michael Paus
1996-07-08  0:00     ` Robert A Duff
1996-07-08  0:00     ` John Herro
1996-07-08  0:00       ` Robert Dewar
1996-07-08  0:00       ` Robert Dewar
1996-07-10  0:00         ` John Herro
1996-07-10  0:00           ` Robert Dewar
1996-07-09  0:00       ` progers
1996-07-09  0:00       ` Robert A Duff [this message]
1996-07-09  0:00         ` Robert Dewar
1996-07-04  0:00 ` Jon S Anthony
1996-07-03  0:00   ` Robert Dewar
1996-07-03  0:00   ` Robert Dewar
1996-07-04  0:00   ` Robert A Duff
1996-07-05  0:00 ` Jon S Anthony
1996-07-05  0:00 ` Jon S Anthony
1996-07-06  0:00   ` Robert Dewar
1996-07-09  0:00 ` Jon S Anthony
1996-07-09  0:00 ` Jon S Anthony
1996-07-09  0:00   ` Robert Dewar
1996-07-12  0:00   ` Jon S Anthony
1996-07-21  0:00     ` Robert A Duff
1996-07-11  0:00 ` Jon S Anthony
1996-07-11  0:00   ` Robert A Duff
1996-07-12  0:00   ` Robert Dewar
1996-07-14  0:00 ` Norman H. Cohen
1996-07-15  0:00   ` Robert Dewar
1996-07-15  0:00 ` Jon S Anthony
1996-07-15  0:00   ` Robert Dewar
1996-07-16  0:00 ` Jon S Anthony
replies disabled

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