comp.lang.ada
 help / color / mirror / Atom feed
From: johnherro@aol.com (John Herro)
Subject: Re: seperate keyword and seperate compilation with Gnat?
Date: 1996/07/08
Date: 1996-07-08T00:00:00+00:00	[thread overview]
Message-ID: <4rrcal$hhh@newsbf02.news.aol.com> (raw)
In-Reply-To: dewar.836427220@schonberg


dewar@cs.nyu.edu (Robert Dewar) wrote:
> subunits are a nasty source of problems ("of
> course we know if a scope contains tasks
> or not at compile time .... oops, no we don't
> -- subunits! darn!")
     This is just one aspect of a much broader problem: in many cases,
allowing for certain options may reduce efficiency of the generated code,
and Ada has a *lot* of options.  In this case, generating code for the
parent before the subunit is written would lead to inefficiency because
the subunit *might* contain tasks.
     Here's how Janus/Ada solved two other problems in this same general
category.  First, long identifier names normally don't affect the
generated code at all.  But that's not true of enumeration types, for
which the compiler must store the identifier names in the generated code
because we *might* use 'Image and 'Value.  For example:

type CLA_Message_Type is (Ask_For_Help, Give_Help, Discuss_Ada,
Please_Do_My_Homework, Flame, Flame_The_Flamer);
procedure Filter_CLA_Messages is separate;

When generating code for the parent, the compiler has to include the
enumeration identifier names in the object code because the separate
procedure might use CLA_Message_Type'Image or CLA_Message_Type'Value.  In
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.
     Second, Janus/Ada 83 for DOS has a compiler/linker switch to tell the
system that the whole program will fit into a .COM file, so it can
generate shorter jumps.
     Permit me to offer a suggestion, even though I have to admit that I
don't have the Gnat compiler.  (I'm paying America Online 5 cents a minute
for access, and have no idea what it would cost me to download ez2load - I
know, I should get a *real* ISP!)  How about a pragma or compiler switch
to tell Gnat that the whole program won't use tasking?  Then it could
generate efficient code for the parent before the subunit is written, and
wouldn't have to recompile the parent when the subunit changes.
     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.
- John Herro
Software Innovations Technology
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor




  reply	other threads:[~1996-07-08  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 ` Peter Hermann
1996-07-02  0:00   ` David Morton
1996-07-02  0:00 ` Samuel Mize
1996-07-03  0:00   ` *separate* keyword and *separate* " David Morton
1996-07-03  0:00     ` Robert Dewar
1996-07-03  0:00   ` seperate keyword and seperate " Robert Dewar
1996-07-17  0:00   ` Robert I. Eachus
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 Dewar
1996-07-08  0:00     ` John Herro [this message]
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
1996-07-09  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-03  0:00   ` Robert A Duff
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   ` Robert Dewar
1996-07-12  0:00   ` Jon S Anthony
1996-07-21  0:00     ` Robert A Duff
1996-07-09  0:00 ` Jon S Anthony
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