From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,88b676af04f3073d X-Google-Attributes: gid103376,public From: nobody@REPLAY.COM (Anonymous) Subject: Re: Ada generics are bad Date: 1998/04/09 Message-ID: <199804091501.RAA21609@basement.replay.com>#1/1 X-Deja-AN: 342429851 Content-Transfer-Encoding: 7bit References: Content-Type: text/plain; charset=us-ascii Organization: Replay Associates, L.L.P. Mail-To-News-Contact: postmaster@nym.alias.net X-001: Replay may or may not approve of the content of this posting X-002: Report misuse of this automated service to X-URL: http://www.replay.com/remailer/ Newsgroups: comp.lang.ada Date: 1998-04-09T00:00:00+00:00 List-Id: 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/