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-Thread: a07f3367d7,cb04cee6116c8ced X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Package's private parts and protected types Date: Thu, 11 Feb 2010 19:10:49 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <7ff3810f-3ee3-4f39-a54c-933ad7d0655c@36g2000yqu.googlegroups.com> <1v2la97s2yyvd.1rcy0ana8mver.dlg@40tude.net> <3bb38996-47f7-4f30-8255-f011501404b5@b10g2000yqa.googlegroups.com> <1qttzk1jbh24i$.xid2h7me3oec.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1265937051 23417 69.95.181.76 (12 Feb 2010 01:10:51 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 12 Feb 2010 01:10:51 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:9141 Date: 2010-02-11T19:10:49-06:00 List-Id: "Robert A Duff" wrote in message news:wccr5orgwhd.fsf@shell01.TheWorld.com... > "Randy Brukardt" writes: > >>...(For Janus/Ada, at least, every source file is compiled >> separately, and code is generated as necessary without needing anything >> other than direct semantic dependencies to have been previously compiled. >> That model is impossible for separate private parts; the specification >> would >> not contain enough information to generate any code or any code for calls >> to >> it.) > > The Ada 83 model seemed to be that the compiler doesn't need to look at > with'ed bodies to generate code. But that's bogus. It's not bogus, the existence of Janus/Ada demonstrates that. And other Ada 83 compilers worked that way as well. > All Ada compilers > other than Janus/Ada look at bodies to generate code for generic > instantiations. And you need to look at bodies to implement > inlining properly. (Does Janus/Ada implement inlining?) > Similarly for any other inter-package optimizations. I don't believe in inlining(*). Nor inter-package optimizations in typical compilation modes. Our model is that the only dependencies are the actual semantic dependencies caused by with clauses (and stubs, which work much like with clauses). Everything was designed to have tolerable compilation speeds on original PCs, and no program library at all (just a pile of files somewhere). Obviously, those choices aren't as important these days, I wouldn't design it the same if I was starting today. (*) I think inlining is something that should be done automatically by the compiler. I see no reason at all to clutter source code with hints that the compiler could figure out better on its own. It would be much better if the source was annotated with the intended time/space tradeoffs: make this loop as fast as possible, make this rarely used subsystem as small as possible, make everything else "normal". This is one advantage that just-in-time compilation has: it actually has data to suggest what is important. I also believe that the only reasonable compilation model in the limit is of full program compilation - if I started a compiler design today I would build it around that model where most of the work is done at what today is called "link-time". (Or even just-in-time.) So if we're talking hypothetical languages, compilation would also be very different. But this is an Ada forum, and I'm not much interested in hypotheticals. Randy.