comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Package's private parts and protected types
Date: Thu, 11 Feb 2010 19:10:49 -0600
Date: 2010-02-11T19:10:49-06:00	[thread overview]
Message-ID: <hl29qr$mrp$1@munin.nbi.dk> (raw)
In-Reply-To: wccr5orgwhd.fsf@shell01.TheWorld.com

"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message 
news:wccr5orgwhd.fsf@shell01.TheWorld.com...
> "Randy Brukardt" <randy@rrsoftware.com> 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.





  reply	other threads:[~2010-02-12  1:10 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08  4:30 Package's private parts and protected types Hibou57 (Yannick Duchêne)
2010-02-08  8:30 ` Martin
2010-02-08  9:11   ` Hibou57 (Yannick Duchêne)
2010-02-08 10:10     ` Alex R. Mosteo
2010-02-08 10:46       ` Hibou57 (Yannick Duchêne)
2010-02-09 14:55         ` Alex R. Mosteo
2010-02-08 10:20   ` Dmitry A. Kazakov
2010-02-08 10:54     ` Hibou57 (Yannick Duchêne)
2010-02-08 10:58       ` Hibou57 (Yannick Duchêne)
2010-02-08 11:01       ` Dmitry A. Kazakov
2010-02-08 13:19         ` Georg Bauhaus
2010-02-08 15:17         ` Robert A Duff
2010-02-08 16:15           ` (see below)
2010-02-08 20:44             ` Robert A Duff
2010-02-08 22:00               ` Hibou57 (Yannick Duchêne)
2010-02-09  5:48               ` AdaMagica
2010-02-09 14:56                 ` Robert A Duff
2010-02-10  2:29                   ` Randy Brukardt
2010-02-11 23:46                     ` Robert A Duff
2010-02-12  1:29                       ` Randy Brukardt
2010-02-11 23:53                     ` Robert A Duff
2010-02-12  1:10                       ` Randy Brukardt [this message]
2010-02-10 16:05                   ` Adam Beneschan
2010-02-10 20:17                     ` sjw
2010-02-12  0:05                     ` Robert A Duff
2010-02-12 11:07                       ` Stephen Leake
2010-02-12 15:01                         ` Robert A Duff
2010-02-13  8:00                           ` Stephen Leake
2010-02-09  9:04               ` stefan-lucks
2010-02-08 17:11           ` Jeffrey R. Carter
2010-02-08 14:56       ` Robert A Duff
2010-02-08 15:36         ` Dmitry A. Kazakov
2010-02-08 16:06           ` Robert A Duff
2010-02-08 17:46             ` Jean-Pierre Rosen
2010-02-08 20:39               ` Robert A Duff
2010-02-08 21:54                 ` Hibou57 (Yannick Duchêne)
2010-02-08 21:50               ` Hibou57 (Yannick Duchêne)
2010-02-08 22:04         ` Hibou57 (Yannick Duchêne)
2010-02-09 10:58         ` Hibou57 (Yannick Duchêne)
2010-02-09 14:47           ` Robert A Duff
2010-02-09 19:34             ` Hibou57 (Yannick Duchêne)
2010-02-09 20:19               ` Hibou57 (Yannick Duchêne)
2010-02-09 23:29               ` Robert A Duff
2010-02-10  2:39               ` Randy Brukardt
2010-02-10  5:12                 ` Hibou57 (Yannick Duchêne)
2010-02-10  7:17                   ` Hibou57 (Yannick Duchêne)
2010-02-10 16:09                   ` Robert A Duff
2010-02-10 22:21                     ` Hibou57 (Yannick Duchêne)
2010-02-11  0:48                       ` Robert A Duff
2010-02-09  0:48     ` Randy Brukardt
2010-02-09 12:43     ` Hibou57 (Yannick Duchêne)
replies disabled

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