comp.lang.ada
 help / color / mirror / Atom feed
From: nobody@REPLAY.COM (Anonymous)
Subject: Re: Ada generics are bad
Date: 1998/04/09
Date: 1998-04-09T00:00:00+00:00	[thread overview]
Message-ID: <199804091501.RAA21609@basement.replay.com> (raw)
In-Reply-To: Er3npt.4sK@array.ca


On Wed, 8 Apr 1998 14:46:40 GMT, glee@array.ca (Glenden Lee) wrote:

> Is it just our compiler or are all compilers this dumb... When a package 
> body that contains the body of generic units get changed, all other 
> packages that instantiate the generics must be recompiled as well.  This 
> is contrary to the claim that generics save compilation time as some 
> literature states...
> 
> That's all... I just wanted to vent some frustration... and besides the 
> compiler is recompiling everything right now just because I did the above...
> ...

I've never seen this claim (that generics save compilation time).
Generics reduce the amount of source code (in your case, I suspect,
significantly).

While generics can, and in some cases have been, implemented using code
sharing (RR Software's Janus Ada comes to mind), many compilers treat a
generic as a kind of template for macro expansion, and effectively
compile a modified version of the code for each instantiation. In such
cases, a generic instantiation creates a dependency on the body of the
generic, requiring recompilation of the instantiation whenever the body
of the generic changes.

Generics should be mature pieces of code that are frequently reused, so
their bodies should rarely change. However, such maturity is difficult
to achieve at first writing, so such "growing pains" should be expected
when using generics that are still under development. However, the
savings in duplicate code are well worth the pain. You are to be
commended for taking the long view and doing this right from the start.

Compare this to one DOD project I had the pleasure of working on: As one
example out of very many, we found about 350 procedures named
Open_The_Window which were identical except for the name of the window
being opened. Imagine the joys of modifying that system when the time
comes (as it comes to all).

Jeff Carter  PGP:1024/440FBE21
My real e-mail address: ( carter @ innocon . com )
"I unclog my nose towards you."
Monty Python & the Holy Grail

Posted with Spam Hater - see
http://www.compulink.co.uk/~net-services/spam/




  parent reply	other threads:[~1998-04-09  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-08  0:00 Ada generics are bad Glenden Lee
1998-04-08  0:00 ` Tucker Taft
1998-04-09  0:00 ` Anonymous [this message]
1998-04-10  0:00 ` Christopher Green
1998-04-10  0:00   ` Brian Rogoff
1998-04-11  0:00   ` Robert Dewar
1998-04-13  0:00     ` Christopher Green
1998-04-13  0:00       ` Matthew Heaney
1998-04-13  0:00         ` Christopher Green
1998-04-13  0:00         ` nabbasi
1998-04-13  0:00           ` future of proprietry source code (was: Ada generics are bad) Fergus Henderson
1998-04-14  0:00             ` David Masterson
1998-04-16  0:00               ` David Kastrup
1998-04-16  0:00                 ` David Masterson
1998-04-17  0:00                   ` David Kastrup
1998-04-17  0:00               ` campo
1998-04-16  0:00             ` Tim Smith
1998-04-17  0:00               ` Thomas Bushnell, n/BSG
1998-04-18  0:00                 ` Bill Gribble
1998-04-20  0:00                   ` Ole-Hjalmar Kristensen
1998-04-21  0:00             ` William Tanksley
1998-04-14  0:00         ` Ada generics are bad Robert Munck
1998-04-14  0:00           ` Matthew Heaney
1998-04-15  0:00           ` Jonathan Guthrie
1998-04-14  0:00         ` Al Christians
replies disabled

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