comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Ada OOP alternatives?
Date: Fri, 18 Jul 2008 08:45:20 -0400
Date: 2008-07-18T08:45:20-04:00	[thread overview]
Message-ID: <wcc63r3pdi7.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: g5oklk$3sg$1@jacob-sparre.dk

"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message 
> news:wccy741fg0z.fsf@shell01.TheWorld.com...
>> "(see below)" <yaldnif.w@blueyonder.co.uk> writes:
>>
>>> On 17/07/2008 01:05, in article wcc3am9gytt.fsf@shell01.TheWorld.com,
>>> "Robert A Duff" <bobduff@shell01.TheWorld.com> wrote:
>>>> I'd still rather eliminate private parts altogether.
>>>
>>> How would you do that while allowing ADT clients to access objects 
>>> directly
>>> (i.e. not via a pointer a la Java)?
>>
>> I'd have the compiler take a peek at the body when compiling the client.
>> After all, that's what Ada compilers already do for pragma Inline.
>
> That's what *some* Ada compilers do. Personally, I think that violates the 
> spirit of Ada (Ichbiah version) by adding unnecessary compilation 
> dependencies. Indeed, I think the whole design of pragma Inline is wrong in 
> Ada.

Not sure what you mean.  In order to inline a call, the compiler has to
look at the body of the callee -- no way around that.  And when the body
of the callee changes, the code at the inlined call site needs to be
changed.  It's certainly annoying when unrelated changes in the
same file where the inlined body lives trigger recompilation of the
world.  And that is avoidable via incremental compilation.

As to the inline violating spirits, Ichbiah presumably designed whatever
"spirit" you mean, and also designed pragma Inline, so are you saying
Ichbiah violated the spirit of Ada?  It's certainly possible...

Anyway, what's your idea about how the design of inline should be?

> ...
>> We're just talking about the size of the type, really -- you say
>> "access objects", but clients can't access the record components
>> of a private type -- all they can do is declare objects and
>> pass them around.
>
> Ugh. That's surely not true, either, unless you insist on allocating all 
> objects contiguously.

I'm confused.  I don't see how allocating noncontiguously contradicts
what I said -- which part were you referring to.

>...And I see absolutely no reason to do that in 
> general -- the limitations that it puts on the programmer are unnecessary 
> and impossible to see. (Particular cases for particular [usually 
> safety-critical] programs are a very different story of course -- but 
> safety-critical users are going to put all kinds of restrictions on 
> themselves which don't mean that they are a good idea for the rest of us.)

I agree with that general point.

> There are a lot of different ways to design a compilation system, and one 
> thing we've clearly learned from the ARG is that making any sort of 
> assumptions about how "everyone" is going to implement something are almost 
> certainly wrong.

Well, I suppose so, but "everyone" has to implement whatever language
they're implementing in a way that is correct.  (E.g. using a one-pass,
bottom-up overload resolution algorithm is just plain wrong, for Ada.)

And it is the responsibility of the language designer to make sure that
there is at least one viable implementation strategy -- not to make sure
that every imaginable implementation strategy is viable.

>... Language design has to be more general than that (unless 
> you are willing to have a sole-source language like Eiffel, and those are 
> almost never interesting).

I think Eiffel has more than one implementation.

- Bob



  reply	other threads:[~2008-07-18 12:45 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 20:38 Ada OOP alternatives? raould
2008-07-16  0:15 ` Robert A Duff
2008-07-16  6:33   ` Georg Bauhaus
2008-07-16  9:54     ` Alex R. Mosteo
2008-07-16 13:03       ` Dmitry A. Kazakov
2008-07-16 14:07       ` Robert A Duff
2008-07-16 18:11         ` (see below)
2008-07-17  0:05           ` Robert A Duff
2008-07-17  0:43             ` (see below)
2008-07-17  1:36               ` Robert A Duff
2008-07-17 11:07                 ` (see below)
2008-07-17 16:45                   ` Robert A Duff
2008-07-17 12:00                 ` Dmitry A. Kazakov
2008-07-17 16:50                   ` Robert A Duff
2008-07-17 18:56                     ` Dmitry A. Kazakov
2008-07-18 12:54                       ` Robert A Duff
2008-07-18 13:36                         ` Dmitry A. Kazakov
2008-07-17 23:27                 ` Randy Brukardt
2008-07-18 12:45                   ` Robert A Duff [this message]
2008-07-18 23:22                     ` Randy Brukardt
2008-07-22 20:32                 ` Adam Beneschan
2008-07-22 22:18                   ` Ludovic Brenta
2008-07-23  9:25                     ` Alex R. Mosteo
2008-07-22 23:35                   ` Randy Brukardt
2008-07-23  7:56                   ` Dmitry A. Kazakov
2008-07-23 21:04                     ` Robert A Duff
2008-07-24  7:07                       ` stefan-lucks
     [not found]                       ` <5ob7w7usrc74$.kms2e1vqs4k0.dlg@40tude.net>
     [not found]                         ` <48883529$0$18826$9b4e6d93@newsspool2.arcor-online.net>
     [not found]                           ` <ygdmhl22lzh4$.1dx98hja6p2o6.dlg@40tude.net>
     [not found]                             ` <48883f41$0$18829$9b4e6d93@newsspool2.arcor-online.net>
     [not found]                               ` <6i1s0y8eeka.121ek9qcgunha$.dlg@40tude.net>
     [not found]                                 ` <48885757$0$18818$9b4e6d93@newsspool2.arcor-online.net>
2008-07-24 12:48                                   ` Dmitry A. Kazakov
2008-07-25  8:47                                     ` Georg Bauhaus
2008-07-25 13:28                                       ` Dmitry A. Kazakov
2008-07-25 16:24                                         ` Georg Bauhaus
2008-07-25 17:55                                           ` Dmitry A. Kazakov
2008-07-26  5:05                   ` Jeff Koftinoff
2008-07-16 14:03     ` Robert A Duff
2008-07-16 14:29       ` Dmitry A. Kazakov
replies disabled

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