From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Distilled by Richard Riehle Date: Fri, 27 Jul 2018 23:32:50 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <72ccb7fa-a9cb-42e6-8c29-3c06da281a45@googlegroups.com> <2212eb54-cb4a-446f-9cdf-287ef220e2c2@googlegroups.com> <1b5a58b2-65b7-4df8-80b5-03e208d249e1@googlegroups.com> <99a9127d-1024-4690-aa1d-8b3026a0f57d@googlegroups.com> NNTP-Posting-Host: IzvqdhUtDGKIMCldyDtZ+w.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:53989 Date: 2018-07-27T23:32:50+02:00 List-Id: 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