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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,CP1252 X-Google-Thread: 103376,d6f7b92fd11ab291 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-18 10:18:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F182BDC.9070208@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Crosspost: Help wanted from comp.compilers References: <1058275843.720814@master.nyc.kbcfp.com> <3F158832.1040206@attbi.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 66.31.71.243 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc52.ops.asp.att.net 1058548708 66.31.71.243 (Fri, 18 Jul 2003 17:18:28 GMT) NNTP-Posting-Date: Fri, 18 Jul 2003 17:18:28 GMT Organization: Comcast Online Date: Fri, 18 Jul 2003 17:18:28 GMT Xref: archiver1.google.com comp.lang.ada:40475 Date: 2003-07-18T17:18:28+00:00 List-Id: Preben Randhol wrote: > Perhaps I misunderstand you, but if you make the .ali files read-only > the library won't be recompiled when you with a unit in your program. If > it needs to be due to change of compiler or some other reason the > compiler will stop compiling and tell you it is needed. But I guess you > were refering to something else? You misunderstood. The specifications of all units, usually packages, that you with are recompiled everytime. This does not affect the status of that unit. It is just that it is faster and easier to do those recompiles than to store an intermediate representation of the spec. To compare the two approaches: Old way: When you compile a package specification, a library entry is created containing a processed version of the package spec. When you compile a unit that withs that package, the processed version is found and loaded into the compiler. GNAT way: IF you compile a package specification, the compiler checks it for errors and does nothing else. (Well it gives you a message saying no code generated. Go do gnatmake foo.ads for some package specification you have lying around to try it.) When you compile a body (foo.adb) the complier creates a transitive closure of the with clauses, compiling each specification as found. The compiler then compiles the body, including any subunits, creates an object file (and other files) and puts them in the directory (program library). Are there cases where doing things the old way would be faster? Sure. But in the majority of cases the new GNAT approach, shared by some other Ada 95 compilers is faster. And as far as I am concerned, it is better for actual Ada programmers. This goes back to a very old paper, "Nesting in Ada is for the Birds," by L. Clarke, J. Wileden & A. Wolf, ACM SIGPLAN Notices 15, 11 (1980), 139-145. (How's that for Googling an old reference out of nowhere. ;-) In Ada trees tend to become shorter and bushier as programmers get more familiar with Ada style. So for all I know, compiling specs into the library was the right model for Ada 83, but the new model is better now. -- Robert I. Eachus �In an ally, considerations of house, clan, planet, race are insignificant beside two prime questions, which are: 1. Can he shoot? 2. Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and Steve Miller.