comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Possible Ada deficiency?
Date: Wed, 12 Jan 2005 13:57:40 -0600
Date: 2005-01-12T13:57:40-06:00	[thread overview]
Message-ID: <xPmdnUo9mIROHXjcRVn-jg@megapath.net> (raw)
In-Reply-To: wcc4qhn4q26.fsf@shell01.TheWorld.com

"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
news:wcc4qhn4q26.fsf@shell01.TheWorld.com...
> "Randy Brukardt" <randy@rrsoftware.com> writes:
> > Sure, but if the extra rebuild time isn't significant, who cares?
>
> It's still significant today.  I won't be completely satisfied until my
> rebuild time (after changing one or several files) is less than 0.2
> second (because 0.2 second is unnoticeable at the human interaction
> level).

OK, but I was talking about significant compared to the "normal" build time.
I don't think that sort of build time will ever be practical for Ada. My
goal is the next "step" up in human response, which is somwhere between
10-30 seconds. As long as the build is done before I finish taking a drink,
its quick enough. (You're going to pause anyway, 'cause you can't work
continuously for hours...).

> > I certainly wasn't the only one to share generics by default.
>
> I have no problem with sharing by default.  But I wonder if Ichbiah's
> team had viewed that as the philosophy, why didn't they define the
> semantics that way?  (Analogy with procedure calls: the RM does not
> define them in terms of copying the called procedure to the call site,
> and then expect pragma Not_Inline to turn that off!)

I don't know; I presume they were confused as to what they were defining
(that happens when it hasn't really been done before).

> And why did they forbid recursive instantiations?

Probably to allow alternate implementations; they were not sure which model
made sense, so they allowed them all.

...
> > There are many rules of Ada 95 that make sharing impractical (not
> > impossible, just impractical).
>
> I've heard the same comment from some folks at Rational.
> It surprised me at the time, because the design team really
> tried to make generic body sharing *easier* in Ada 95.  Honest.

Certainly, the effects of "aliased" were more in the "unintended
consequences" category.

> One thing that makes sharing hard (in Ada 83) is the semantics of
> exceptions declared in generics.  Tucker pushed quite hard to change
> that rule, but it was seen as too incompatible, so we gave up on that
> idea.
>
> But don't we get a little credit for tightening up the generic contract
> model?  ;-)

Sure. But "assume-the-best" means lots of additional stuff to pass to the
generic, and not all at the head. So it makes it harder than just having it
illegal as appeared to be the case in Ada 83.

> > > I don't understand that, either.  Are you saying that the run-time
> > > overhead of the always-share model is now acceptable?
> >
> > No, I was thinking of the time/space requirements for building such a
> > compiler "properly". We didn't really implement my design because our
hosts
> > didn't have enough memory to store the intermediate code for the entire
> > program, and a disk-based solution would be way too slow. It would be
> > practical on modern machines (other than that I can't predict the
> > performance of the optimization pass, which would be critical to making
the
> > scheme work. We'd have to build it to see).
> >
> > Note that with the design that I had in mind, the run-time overhead of
> > "always share" (as you put it) would be greatly reduced by partial
> > evaluation and inlining optimizations -- done at link-time so that all
of
> > the instantiations and calls are known. Plus, pragma Inline could be
used to
> > reduce the overhead to nearly nil on critical stuff. The problem isn't
the
> > run-time overhead so much as it is supporting the optimizations
necessary to
> > mitigate it.
>
> If you're doing that sort of inlining, I wouldn't call it "always share"
> anymore.  I'd call it "sometimes share" or "partial sharing".  The whole
> point would be to reduce or eliminate what I called "the run-time
> overhead of the always-share model".

I find that confused. Inlining and partial evaluation are optimizations,
applied after the semantics of the program is encoded. After all, automated
inlining and partial evaluation would be useful in many cases having nothing
to do with generics. OTOH, "always share" is a basic part of the semantics,
and it is the only thing that the front-end knows. The front-end never does
any inlining.

I suppose from the point of view of a user, the effect is essentially the
same. But from the point of view of the processor design, the optimizer and
the front-end know almost nothing about each other, and things that happen
in one have no bearing on what happens in the other. (In our case, that
distinction is quite strictly enforced. I've fixed the optimizer
independently of the front-end on many occassions, even giving customers the
fixed back-end to use with an older front-end.)

As I've said before, this is all in theory; we never built the link-time
optimizer, these days because of tiny little problems (like the fact that
our debugger format assumes one source file per generated code file; and
that intemediate code label numbers would have to resequenced; etc.). So
perhaps it wouldn't work well in practice.

                               Randy.







  reply	other threads:[~2005-01-12 19:57 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-31 18:15 Possible Ada deficiency? danmcleran
2004-12-31 19:12 ` Jeffrey Carter
2005-01-01  1:52   ` danmcleran
2005-01-01  2:37     ` Jeffrey Carter
2005-01-01  2:02   ` danmcleran
2005-01-01 14:11     ` Martin Krischik
2005-01-01 15:27       ` danmcleran
2005-01-02 17:49         ` Martin Krischik
2005-01-01 15:30     ` Stephen Leake
2005-01-01 15:57       ` danmcleran
2005-01-03 23:37         ` Randy Brukardt
2005-01-07 17:26           ` Nick Roberts
2005-01-07 18:26             ` danmcleran
2005-01-07 21:32             ` Randy Brukardt
2005-01-08  3:56               ` Nick Roberts
2005-01-08 18:15                 ` Robert A Duff
2005-01-08 19:11                   ` Jeffrey Carter
2005-01-08 20:03                     ` Robert A Duff
2005-01-09  3:40                       ` Jeffrey Carter
2005-01-09 17:30                         ` Robert A Duff
2005-01-09 19:24                           ` Jeffrey Carter
2005-01-09 21:56                           ` Nick Roberts
2005-01-10 13:47                             ` Dmitry A. Kazakov
2005-01-10 16:46                               ` Duncan Sands
2005-01-10 17:58                                 ` Pascal Obry
2005-01-10 18:45                                   ` Dmitry A. Kazakov
2005-01-10 19:44                                     ` Pascal Obry
2005-01-11 10:05                                       ` Dmitry A. Kazakov
2005-01-11  7:24                                     ` Vinzent 'Gadget' Hoefler
2005-01-11  9:48                                       ` Dmitry A. Kazakov
2005-01-11 13:57                                         ` Vinzent 'Gadget' Hoefler
2005-01-11 21:52                                           ` Robert A Duff
2005-01-12 11:22                                           ` Dmitry A. Kazakov
2005-01-09 17:23                   ` danmcleran
2005-01-09 17:46                     ` Robert A Duff
2005-01-10  3:05                       ` danmcleran
2005-01-09 18:41                   ` Nick Roberts
2005-01-09 19:06                     ` Martin Krischik
2005-01-09 20:10                     ` Robert A Duff
2005-01-09 20:15                     ` Robert A Duff
2005-01-11 14:13                       ` Possible Ada deficiency? (goto) Peter Hermann
2005-01-11 14:54                         ` Nick Roberts
2005-01-11 22:15                         ` Robert A Duff
2005-01-12 10:17                           ` Peter Hermann
2005-01-15 17:34                             ` Robert A Duff
2005-01-15 17:58                               ` Dmitry A. Kazakov
2005-01-15 19:34                                 ` Robert A Duff
2005-01-10 20:15                   ` Possible Ada deficiency? Randy Brukardt
2005-01-10 21:51                     ` Robert A Duff
2005-01-11 20:23                       ` Randy Brukardt
2005-01-11 21:24                         ` Robert A Duff
2005-01-12 19:57                           ` Randy Brukardt [this message]
2005-01-02 15:51       ` Adrian Hoe
2005-01-04 16:06       ` Peter Hermann
2005-01-01 23:36     ` tmoran
2005-01-02  3:38       ` danmcleran
2004-12-31 19:16 ` Martin Dowie
2005-01-01  2:32   ` Jeffrey Carter
2004-12-31 23:23 ` Nick Roberts
2005-01-01  1:56   ` danmcleran
2005-01-01 11:43 ` Dmitry A. Kazakov
2005-01-01 15:46   ` danmcleran
2005-01-01 17:58     ` Larry Kilgallen
2005-01-01 19:43       ` danmcleran
2005-01-02  0:36         ` Ed Falis
2005-01-02  3:36           ` danmcleran
2005-01-02 15:53             ` Ed Falis
2005-01-07 18:31               ` danmcleran
2005-01-07 18:44                 ` Pascal Obry
2005-01-07 19:29                   ` danmcleran
2005-01-07 21:28                     ` Pascal Obry
2005-01-01 23:28   ` danmcleran
2005-01-02 10:26     ` Dmitry A. Kazakov
2005-01-02 15:51       ` danmcleran
2005-01-03 23:48     ` Randy Brukardt
2005-01-01 14:06 ` Martin Krischik
2005-01-01 15:53   ` danmcleran
2005-01-07 21:33 ` Robert A Duff
2005-01-09 17:15   ` danmcleran
2005-01-09 17:38     ` Robert A Duff
2005-01-10  3:16       ` danmcleran
2005-01-09 18:41     ` Martin Dowie
2005-01-10  3:18       ` danmcleran
2005-01-10 20:32         ` Randy Brukardt
2005-01-10 21:42           ` danmcleran
2005-01-10 21:36         ` Robert A Duff
2005-01-10 21:44           ` danmcleran
2005-01-09 19:01     ` Jeffrey Carter
2005-01-10  3:20       ` danmcleran
2005-01-10 22:16         ` Robert A Duff
2005-01-10 22:29           ` danmcleran
2005-01-11 20:12             ` Georg Bauhaus
2005-01-11 20:30               ` danmcleran
2005-01-11 21:44               ` Robert A Duff
2005-01-11  0:06           ` Jeffrey Carter
2005-01-11  0:46             ` Robert A Duff
2005-01-11 20:37           ` danmcleran
2005-01-11 21:08             ` Robert A Duff
2005-01-17  4:40 ` Tucker
2005-01-18 13:46   ` danmcleran
2005-01-18 21:29     ` Nick Roberts
2005-01-24 17:23   ` danmcleran
  -- strict thread matches above, loose matches on Subject: below --
2004-12-31 19:06 danmcleran
replies disabled

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