comp.lang.ada
 help / color / mirror / Atom feed
From: "Dan'l Miller" <optikos@verizon.net>
Subject: Re: Ada Successor Language
Date: Fri, 29 Jun 2018 12:46:46 -0700 (PDT)
Date: 2018-06-29T12:46:46-07:00	[thread overview]
Message-ID: <a0a588d0-69c9-41f7-90d2-7497a5bea46c@googlegroups.com> (raw)
In-Reply-To: <ph5qtc$gqg$1@gioia.aioe.org>

On Friday, June 29, 2018 at 12:39:59 PM UTC-5, Dmitry A. Kazakov wrote:
> On 2018-06-29 15:25, Dan'l Miller wrote:
> > On Friday, June 29, 2018 at 2:20:40 AM UTC-5, Dmitry A. Kazakov wrote:
> >> On 2018-06-29 05:11, Paul Rubin wrote:
> >>> "Dan'l Miller" writes:
> >>>> bad idea that threatens to bring C++ slicing to Ada
> >>>
> >>> Are you talking about this?
> >>>
> >>>      https://en.wikipedia.org/wiki/Object_slicing
> >>>
> >>> Does Ada somehow escape from it now?
> >>
> >> Sure, there is no way to reconstruct that in Ada.
> >>
> >>> It does sound bad.
> >>
> >> Only due to C++ design fault. Assignment is a classic multiple dispatch
> >> operation (a multi-method). C++ per design does no support MD. Here you go.
> >>
> >> With MD it is no more an issue. Let T and S be two types T <: S. The
> >> assignment operation of mixed arguments and result
> >>
> >>      ":=" : S x T -> S
> >>
> >> could not be safely inherited by S from T's:
> >>
> >>      ":=" : T x T -> T
> >>
> >> Therefore the compiler would ask the programmer to override it (or
> >> redesign). Problem solved.
> > 
> > Dmitry, you make it sound as though multiple •dispatch• would solve slicing in C++ (which has no
> > dispatch whatsoever).
> 
> I said nothing about •dispatch•! All types in question are statically known!

Dmitry, do you even read what you write?  In what you just wrote 12 hours ago above, the “classic multiple •dispatch•”, the “does no[t] support •MD•” where MD = multiple •dispatch•, the “compiler would ask the programmer to •override• it” via the OO tag/vtable mechanism, and the “••Problem solved••” all directly mention multiple •dispatch• and how MD is directly related to the remedy to maldesigns in user-provided assignment operators in your direct reply to slicing via C++ assignment.

Turing test and uncanny valley come to mind.

> > In the situations where slicing occurs, it is due to the old backwards-compatibility-with-C functionality in C++.
> 
> I care little of C++ design flaws. There are plenty and C++ is far 
> beyond the point where anything could be done to fix it. I argued that 
> this problem could never occur in Ada with its sane type system.
> 
> The case constituting this bug in C++ is well present in Ada:
> 
>     type T is tagged null record;
>     function F return T;
> 
>     type S is new T with record
>        I : Integer;
>     end record;

That is clearly not analogous to the vicinity where C++'s slicing occurs.  That is analogous to correctly-functioning behavior of C++.

••Hypothetically•• in (not-this-timeline's-)Ada the analogous situation would be in the vicinity of:

a) tagged T is then constrained-subtyped as CST, a constrained subtype of T (to evoke Ada83-era semantics instead of Ada95).

b) Then 2 same-named subprograms would be overloaded to take T as the first parameter and CST as the first parameter.

c) Then tagged S would extend CST instead of T, so that the Ada95-era OO was mixed with the Ada83-era pre-OO inheritance of T to CST.

d) Then the programmer thinks that he is invoking the overloaded subprogram with CST as the first parameter, passing S in,

e) but (if Ada were as botched in certain areas as C++) instead the overloaded program with T as the first parameter is invoked (chopping the S-ness off S) so that the strong typing of S versus T is strictly enforced the wrong way, and the compiler would definitely strongly-typedly work with T when the programmer thought that the context was definitely strongly-typed as S and CST.

This perfect storm is merely one ••hypothetical•• case of trying to cause slicing in Ada via trying to trick the compiler to pick the ‘wrong’ overloaded subprogram of same name.  All the other ways of slicing (e.g., assignment, 'Image, record return value, perhaps generics, and so forth) would have their own contrived Ada95-tagged inheritance versus Ada83-untagged inheritance ••hypothetical•• stress tests that hopefully the _LRM_ individually explicitly carves out as overtly prohibited in at least one way.

There might even be ways of stress-testing potential slicing scenarios in Ada
1) without resorting to Ada83's subtyping at all
or
2) without putting Ada83's subtype constraints in direct •head-to-head• conflict with Ada95's OO tagged record extensions, but rather more obliquely through the interaction of 2 or more other language features (e.g., generics, child packages, private, use).

One would hope that 100% of all the dozen or so contrived* stress-tests would fail to compile (and fail to compile due to overt wording in the _LRM_—not due to spurious misinterpretation of the _LRM_ or due to bug-box compiler internal fault).

* perfect storm of 2 or more Ada{83, 95, 2005, 2012, 2020} language features interacting


  reply	other threads:[~2018-06-29 19:46 UTC|newest]

Thread overview: 212+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02  4:43 Ada Successor Language Shark8
2018-06-02  6:52 ` Luke A. Guest
2018-06-04  2:27   ` Dan'l Miller
2018-06-04 21:06   ` Dan'l Miller
2018-06-05 12:31     ` Lucretia
2018-06-02  8:12 ` Dmitry A. Kazakov
2018-06-02 12:14   ` Mehdi Saada
2018-06-02 12:43     ` Dmitry A. Kazakov
2018-06-03  7:39       ` Safety of user-defined operators (was: Ada Successor Language) G.B.
2018-06-03  7:58         ` Safety of user-defined operators Dmitry A. Kazakov
2018-06-02 12:57     ` Ada Successor Language Luke A. Guest
2018-06-04 21:17       ` Randy Brukardt
2018-06-02 13:48 ` Dan'l Miller
2018-06-03 10:01 ` ric.wai88
2018-06-03 13:04   ` Dan'l Miller
2018-06-03 13:09   ` Shark8
2018-06-03 15:14     ` Lucretia
2018-06-03 15:09   ` Lucretia
2018-06-03 15:14     ` ric.wai88
2018-06-03 15:16       ` Lucretia
2018-06-03 15:22         ` ric.wai88
2018-06-03 15:31           ` Lucretia
2018-06-03 15:41             ` ric.wai88
2018-06-03 15:54     ` Dmitry A. Kazakov
2018-06-03 16:43     ` Jeffrey R. Carter
2018-06-04  5:01       ` Jacob Sparre Andersen
2018-06-04  7:19         ` Simon Wright
2018-06-04  7:44           ` Dmitry A. Kazakov
2018-06-04 13:53             ` Björn Lundin
2018-06-04 16:54             ` G. B.
2018-06-04 19:37               ` Dmitry A. Kazakov
2018-06-04 22:12                 ` G.B.
2018-06-05  7:18                   ` Dmitry A. Kazakov
2018-06-04 13:25           ` Lucretia
2018-06-04 14:08           ` Dan'l Miller
2018-06-04 14:55             ` Lucretia
2018-06-26 13:58         ` jm.tarrasa
2018-06-26 18:44           ` Jacob Sparre Andersen
2018-06-03 18:44     ` Björn Lundin
2018-06-03 19:37     ` Paul Rubin
2018-06-03 23:56       ` Dan'l Miller
2018-06-04  0:24         ` Paul Rubin
2018-06-04  0:41           ` Ben Bacarisse
2018-06-04  2:01         ` ric.wai88
2018-06-05 16:46     ` Alejandro R. Mosteo
2018-06-06 21:02       ` gautier_niouzes
2018-06-08 10:03         ` Alejandro R. Mosteo
2018-06-04  3:19 ` John Smith
2018-06-04 20:56 ` Mehdi Saada
2018-06-04 21:14 ` Paul Rubin
2018-06-05  0:17   ` Shark8
2018-06-05 16:01     ` Dan'l Miller
2018-06-18  3:31     ` Dan'l Miller
2018-06-18  6:58       ` Björn Lundin
2018-06-18 12:33         ` Dan'l Miller
2018-06-18 19:16       ` Niklas Holsti
2018-06-18 19:28         ` Dan'l Miller
2018-06-18 20:22         ` Jeffrey R. Carter
2018-06-18 20:45           ` Niklas Holsti
2018-06-18 21:20             ` Shark8
2018-06-18 21:27               ` ric.wai88
2018-06-18 21:51                 ` Shark8
2018-06-22 11:14                 ` Alejandro R. Mosteo
2018-06-18 22:23               ` Dmitry A. Kazakov
2018-06-18 22:36                 ` Paul Rubin
2018-06-19  0:10                   ` Dan'l Miller
2018-06-19 20:32                     ` Paul Rubin
2018-06-19 20:37                       ` Dan'l Miller
2018-06-20  8:30                     ` Marius Amado-Alves
2018-06-19  7:58                   ` Dmitry A. Kazakov
2018-06-19 19:19                     ` Paul Rubin
2018-06-19 19:30                       ` Dan'l Miller
2018-06-19 19:39                       ` Dmitry A. Kazakov
2018-06-19 20:30                         ` Paul Rubin
2018-06-20  7:13                           ` Simon Wright
2018-06-29 20:11                             ` Randy Brukardt
2018-06-20  7:59                           ` Dmitry A. Kazakov
2018-06-22 11:14                             ` Alejandro R. Mosteo
2018-06-23 19:21                             ` Jacob Sparre Andersen
2018-06-24  8:34                               ` Dmitry A. Kazakov
2018-06-24  9:19                                 ` J-P. Rosen
2018-06-25  7:00                                   ` briot.emmanuel
2018-06-25  8:23                                   ` Marius Amado-Alves
2018-06-29 20:20                                 ` Randy Brukardt
2018-06-25  8:58                               ` Alejandro R. Mosteo
2018-06-25  9:19                                 ` Jeffrey R. Carter
2018-06-25 12:41                                 ` J-P. Rosen
2018-06-25 14:03                                   ` Niklas Holsti
2018-06-25 14:21                                     ` Dmitry A. Kazakov
2018-06-25 14:44                                       ` J-P. Rosen
2018-06-25 15:19                                         ` Dmitry A. Kazakov
2018-06-25 16:21                                           ` Dan'l Miller
2018-06-26  7:44                                             ` Dmitry A. Kazakov
2018-06-26 13:59                                               ` Dan'l Miller
2018-06-26 14:05                                                 ` ric.wai88
2018-06-26 15:38                                                   ` Simon Wright
2018-06-26 16:50                                                     ` Dan'l Miller
2018-06-26 17:25                                                       ` Dmitry A. Kazakov
2018-06-26 18:47                                                         ` Dan'l Miller
2018-06-26 19:29                                                           ` Dmitry A. Kazakov
2018-06-26 20:03                                                             ` Dan'l Miller
2018-06-26 20:59                                                               ` Dmitry A. Kazakov
2018-06-29  3:11                                                               ` Paul Rubin
2018-06-29  3:37                                                                 ` Dan'l Miller
2018-06-29  3:48                                                                   ` Paul Rubin
2018-06-29  7:29                                                                     ` Dmitry A. Kazakov
2018-06-29  7:20                                                                 ` Dmitry A. Kazakov
2018-06-29 13:25                                                                   ` Dan'l Miller
2018-06-29 17:39                                                                     ` Dmitry A. Kazakov
2018-06-29 19:46                                                                       ` Dan'l Miller [this message]
2018-06-29 21:36                                                                         ` Dmitry A. Kazakov
2018-06-29 22:21                                                                           ` Dan'l Miller
2018-06-26 21:15                                                     ` Niklas Holsti
2018-06-27  7:07                                                       ` Dmitry A. Kazakov
2018-06-26 14:17                                                 ` Dmitry A. Kazakov
2018-06-26 14:42                                                   ` Dan'l Miller
2018-06-26 14:47                                                     ` Dmitry A. Kazakov
2018-06-26 21:01                                                 ` Niklas Holsti
2018-06-26 22:03                                                   ` Dan'l Miller
2018-06-27  2:28                                                     ` Dan'l Miller
2018-06-27  2:58                                                       ` Dan'l Miller
2018-06-27  7:15                                                     ` Dmitry A. Kazakov
2018-06-27 16:33                                                       ` Dan'l Miller
2018-06-27 19:11                                                         ` Dmitry A. Kazakov
2018-06-25 18:05                                           ` J-P. Rosen
2018-06-26  7:42                                             ` Dmitry A. Kazakov
2018-06-25 19:32                                         ` Niklas Holsti
2018-06-25 19:16                                       ` Niklas Holsti
2018-06-25 20:13                                         ` Dan'l Miller
2018-06-25 20:52                                           ` Niklas Holsti
2018-06-26  7:57                                             ` Dmitry A. Kazakov
2018-06-26 20:16                                     ` J-P. Rosen
2018-06-26 20:49                                       ` Niklas Holsti
2018-06-26 21:09                                         ` Dmitry A. Kazakov
2018-06-29 20:35                                     ` Randy Brukardt
2018-06-25 14:18                                   ` Alejandro R. Mosteo
2018-06-29 20:47                                     ` Randy Brukardt
2018-06-29 20:23                                 ` Randy Brukardt
2018-07-02  9:37                                   ` Alejandro R. Mosteo
2018-06-29 20:17                             ` Randy Brukardt
2018-06-29 22:11                               ` Dmitry A. Kazakov
2018-06-29 22:36                                 ` Randy Brukardt
2018-06-30  8:34                                   ` Dmitry A. Kazakov
2018-06-19 21:07                         ` Dan'l Miller
2018-06-20  7:33                           ` Dmitry A. Kazakov
2018-06-22 11:13                             ` Alejandro R. Mosteo
2018-06-22 16:02                               ` Dmitry A. Kazakov
2018-06-25  8:20                                 ` Marius Amado-Alves
2018-06-26 17:20                                   ` Shark8
2018-06-26 17:42                                     ` Dmitry A. Kazakov
2018-06-25  8:21                                 ` Paul Rubin
2018-06-25  9:12                                   ` Dmitry A. Kazakov
2018-06-22 15:18                             ` Dan'l Miller
2018-06-22 15:49                               ` Dmitry A. Kazakov
2018-06-19  2:45                 ` Shark8
2018-06-19  7:50                   ` Dmitry A. Kazakov
2018-06-19 15:35                 ` Shark8
2018-06-19  7:35               ` G. B.
2018-06-19 11:36                 ` Dan'l Miller
2018-06-19 15:37                 ` Shark8
2018-06-19 17:07                   ` G. B.
2018-06-29 20:05               ` Randy Brukardt
2018-06-29 23:18                 ` Shark8
2018-07-03 21:39                   ` Randy Brukardt
2018-06-19  0:20         ` Lucretia
2018-06-19 11:51           ` Dan'l Miller
2018-06-19 13:54             ` Dan'l Miller
2018-06-06  9:13   ` Niklas Holsti
2018-06-08 16:28     ` Dan'l Miller
2018-06-08 16:56       ` Mehdi Saada
2018-06-08 17:33       ` Shark8
2018-06-12  1:51         ` Dan'l Miller
2018-06-12 15:23           ` Luke A. Guest
2018-06-12 15:44             ` Dan'l Miller
2018-06-12 17:59               ` Luke A. Guest
2018-06-13 16:03                 ` Dan'l Miller
2018-06-13 16:20                   ` Luke A. Guest
2018-06-13 18:04               ` G. B.
2018-06-13  5:53             ` Shark8
2018-06-13  6:57               ` Simon Wright
2018-06-13 18:58                 ` Shark8
2018-06-13 19:19                   ` Dmitry A. Kazakov
2018-06-14  3:19                     ` Lucretia
2018-06-14  7:26                       ` Dmitry A. Kazakov
2018-06-14 11:25                         ` Lucretia
2018-06-14 12:22                           ` Dmitry A. Kazakov
2018-06-15  3:35                             ` Lucretia
2018-06-15  7:20                               ` Dmitry A. Kazakov
2018-06-15 16:03                                 ` Lucretia
2018-06-15 20:50                                   ` Dennis Lee Bieber
2018-06-15 11:38                     ` jm.tarrasa
2018-06-15 12:06                       ` Dmitry A. Kazakov
2018-06-15 15:42                         ` J-P. Rosen
2018-06-15 17:30                           ` Simon Wright
2018-06-15 17:55                           ` jm.tarrasa
2018-06-15 19:58                             ` Shark8
2018-06-16  7:04                               ` Simon Wright
2018-06-16  9:14                               ` jm.tarrasa
2018-06-16 10:22                                 ` Simon Wright
2018-06-16 10:50                                   ` Jeffrey R. Carter
2018-06-16 11:32                                 ` Dmitry A. Kazakov
2018-06-13 21:15                   ` Paul Rubin
2018-06-14  3:20                     ` Lucretia
2018-06-14  3:27                     ` Shark8
2018-06-14  5:17                       ` Paul Rubin
2018-06-14 21:00                   ` Randy Brukardt
2018-06-15  3:41                     ` Lucretia
2018-06-15  7:08                       ` Dmitry A. Kazakov
2018-06-15  7:15                     ` Simon Wright
2018-06-14  8:51                 ` Marius Amado-Alves
2018-06-08 20:38 ` Mehdi Saada
2018-06-13  5:46   ` Shark8
replies disabled

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