From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Simple example on interfaces
Date: Tue, 26 Jan 2021 21:09:57 -0600 [thread overview]
Message-ID: <ruqli6$rav$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: ruprf8$1h6q$1@gioia.aioe.org
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:ruprf8$1h6q$1@gioia.aioe.org...
...
>> universal_integer is anonymous and doesn't have any operations (except
>> automatic conversion).
>
> Yes. In a never ending discussion with Randy I insist that this stuff
> should be made explicit, available for any types.
As I've often said, for a new language that would certainly be a good idea.
For Ada, reproducing all of the quirks of Ada would lead to an inpentrable
mess. And not reproducing them would break a lot of code (and more
importantly, no one could tell if their code would be broken and in extreme
cases, wouldn't even know as the code would silently change meaning).
As far as full multiple inheritance being too expensive to implement, I tend
to think that is true for interfaces as well. :-) As always, the question is
whether one wants fast code or just something that works. Full multiple
inheritance certainly can be implemented by converting all selectors to
Getter/Setter pairs and dispatching on every use. But that's pretty
expensive for accessing an integer component. Of course, most of the time it
won't matter (Janus/Ada does something like this for shared generics, and I
have yet to have someone complain about performance of generic code). But
there will be cases where it does matter, and this is a distributed
overhead -- it applies to all types whether or not you use it (because
someone could extend this type in some future unit not even written yet).
Randy.
next prev parent reply other threads:[~2021-01-27 3:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-25 16:08 Simple example on interfaces Mario Blunk
2021-01-25 16:41 ` Dmitry A. Kazakov
2021-01-25 17:51 ` Mario Blunk
2021-01-25 22:06 ` Dmitry A. Kazakov
2021-01-26 7:33 ` G.B.
2021-01-26 8:07 ` Dmitry A. Kazakov
2021-01-26 8:17 ` Mario Blunk
2021-01-26 8:55 ` Dmitry A. Kazakov
2021-01-26 9:37 ` J-P. Rosen
2021-01-26 10:25 ` Dmitry A. Kazakov
2021-01-26 11:15 ` AdaMagica
2021-01-26 11:53 ` Dmitry A. Kazakov
2021-01-26 16:46 ` AdaMagica
2021-01-26 19:44 ` Dmitry A. Kazakov
2021-01-26 20:04 ` Shark8
2021-01-26 21:34 ` Dmitry A. Kazakov
2021-01-27 3:11 ` Randy Brukardt
2021-01-27 22:51 ` Shark8
2021-01-30 8:33 ` Randy Brukardt
2021-01-27 3:09 ` Randy Brukardt [this message]
2021-01-27 8:05 ` Dmitry A. Kazakov
2021-01-26 10:02 ` Stephen Leake
2021-01-25 17:00 ` Jeffrey R. Carter
2021-01-27 1:48 ` philip...@gmail.com
2021-01-27 8:06 ` Dmitry A. Kazakov
2021-01-27 3:36 ` Randy Brukardt
2021-01-27 23:04 ` Shark8
2021-01-25 19:05 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox