comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada Distilled by Richard Riehle
Date: Fri, 27 Jul 2018 23:32:50 +0200
Date: 2018-07-27T23:32:50+02:00	[thread overview]
Message-ID: <pjg320$tfe$1@gioia.aioe.org> (raw)
In-Reply-To: 99a9127d-1024-4690-aa1d-8b3026a0f57d@googlegroups.com

On 2018-07-27 22:38, Dan'l Miller wrote:

> I wasn't asking what are Ada's type differences vis a vis the other languages.  I was asking:  how does Ada have a focus on •sets of• types that other languages lack or don't bring forth as fully as a focus on •sets•.

No other language has a proper type representing a closure of a class 
(the set of types rooted in a type T).

>> Types algebra, yes. Most important type operations Ada lacks are:
>>
>> - ad-hoc supertypes,
> 
> {Objective-C, C#, Swift}-esque ad-hoc supertype extension mechanism seems like it would violate some fundamental principles/axioms of Ada:  guaranteeing at compile-time that a dispatch to an object will succeed.

=> It does not have it.

>> - interface inheritance,
> 
> What portion of interface inheritance is Ada lacking?  Are you saying (again) that interface inheritance requires tagged records and that you would like interface inheritance for untagged types?

Interface inheritance means that you inherit only the interface and 
nothing else. Inheritance from a tagged type inherits interface, 
operations and partially the representation. Inheritance per subtype 
inherits everything.

>> - full MI,
> 
> Ewwwwwww.  No, as shown by the debacle of C++'s multiple inheritance, full multiple inheritance is not useful beyond mixin-an-interface inheritance which Ada already has for tagged records.

It is evidently useful:

    type Input_File is
       new Abstract_File with private;
    type Output_File is
       new Abstract_File with private;
    type Input_Output_File is
       new Input_File and Output_File with private;

Mix-in is incredibly dangerous as anybody who actually deployed it knows 
for sure.

>> - full MD
> 
> Full multiple dispatch was added experimentally back in the day for Ada as part of the Ada9X exploratory contracts, by SRI iIRC.

MD is a difficult problem with regard to separate compilation. I don't 
know how to solve it in a consistent way.

But the language design goal should be that any operation declared 
publicly must have all arguments and results controlling or class-wide. 
No contravariance. No type-specific operations.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2018-07-27 21:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-15 18:09 Ada Distilled by Richard Riehle rabbibotton
2018-07-16  1:02 ` Shark8
2018-07-21  6:07   ` Randy Brukardt
2018-07-26  0:42     ` rabbibotton
2018-07-26 20:17       ` Shark8
2018-07-26 21:10         ` Jeffrey R. Carter
2018-07-27  3:01           ` Paul Rubin
2018-07-27 14:32           ` rabbibotton
2018-07-27 20:18             ` Paul Rubin
2018-07-27 17:02           ` Shark8
2018-07-27 14:30         ` rabbibotton
2018-07-27 17:11           ` Shark8
2018-07-27 18:52             ` Dan'l Miller
2018-07-27 20:07               ` Dmitry A. Kazakov
2018-07-27 20:38                 ` Dan'l Miller
2018-07-27 21:32                   ` Dmitry A. Kazakov [this message]
2018-07-28  2:41                     ` Dan'l Miller
2018-07-28  7:10                       ` Dmitry A. Kazakov
2018-07-28 15:01                         ` Dan'l Miller
2018-07-28 15:41                           ` Dmitry A. Kazakov
2018-07-28 16:05                             ` Dan'l Miller
2018-08-06 19:33                             ` Vincent
2018-08-06 22:01                               ` Dmitry A. Kazakov
2021-12-09 11:13                                 ` Kevin Chadwick
2018-07-27 21:34                 ` Shark8
2018-07-27 22:16                   ` Dmitry A. Kazakov
2018-07-28  3:52                 ` Dan'l Miller
2018-07-28  7:12                   ` Dmitry A. Kazakov
2018-07-27 20:35               ` Paul Rubin
replies disabled

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