From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Legit Warnings or not
Date: Thu, 28 Jul 2011 18:48:30 -0500
Date: 2011-07-28T18:48:30-05:00 [thread overview]
Message-ID: <j0ssgf$fia$1@munin.nbi.dk> (raw)
In-Reply-To: go2nk5b4odfy.fpdttridydu6$.dlg@40tude.net
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:go2nk5b4odfy.fpdttridydu6$.dlg@40tude.net...
> On Wed, 27 Jul 2011 19:37:55 -0500, Randy Brukardt wrote:
...
>> Experience with containers shows that no one would use such things unless
>> they were part of the predefined libraries.
>
> What experience? It never was possible in Ada.
No one uses predefined libraries of any kind in Ada unless they either wrote
them themselves or they are part of the standard. Otherwise, people claim
that Ada cannot do X even though it is simple to write a package to do X.
That would absolutely be the result if we adopted your approach. Hardly
anyone would use it, and Ada would be purceived as substantially less
powerful.
>> Moreover, you cannot create a *better* implementation than the one
>> built-into the compiler
>
> See, this is where you approach leads.
The compiler can do virtually *anything* better than the programmer. The
only question is where to draw the line.
>> (Keep in mind that hardly any compilers optimize finalization,
>> even though it is possible and reasonably practical, mainly because of
>> the
>> difficulty of allowing arbitrary user code in such optimizations. The
>> same
>> would be true for your sorts of abstractions.)
>
> Maybe because compiler vendors are too overwhelmed by implementing more
> and
> more magical stuff?
Not at all. This is true because to build a better approach in a library
form, you have to know every possible usage of the library (otherwise, you
have to support the most general case which by definition would have lots of
overhead unnecessary in your specific circumstances). That is not practical
in a language that supports separate compilation and it is not possible at
all if you support shared libraries.
When the compiler does it, it can share the overhead (for pools and
finalization, just to take two examples) and in many cases eliminate it
altogether, based on the form of the type declaration and other properties
that cannot be available inside of a generic container.
>> You seem to want the
>> programmer to work harder (and apparently never want anyone to use
>> dynamic
>> array objects in Ada, since those have the sort of implicit-reference
>> semantics that you claim to hate).
>
> No, I want that dynamic arrays were *arrays*. I want that Ada.Container
> could be selected as an implementation of that array by mere renaming or
> other kind of delegation:
>
> type A is array (Positive range <>) of S'Class;
> private
> package My_Arrays is
> new Ada.Container.Indefinite_Vector (Positive, S'Class);
> type A is new My_Array.Container_Type with null record;
>
> Is it too much?
Yes, for Ada it is too much. Anything implemented now has to be compatible
with the existing language and implementations. For the "Dmitry" language,
feel free.
After all, I'm probably tilting at windmills on this topic, and *the
language already allows this approach*. You want a vastly different approach
that would require massive language and implementation changes. (The above
would be completely impossible with the Janus/Ada shared generic approach,
for instance.) That's not happening any time soon.
Randy.
next prev parent reply other threads:[~2011-07-28 23:48 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-20 22:30 Legit Warnings or not Anh Vo
2011-07-20 23:16 ` Robert A Duff
2011-07-21 18:43 ` Anh Vo
2011-07-23 0:26 ` Randy Brukardt
2011-07-23 14:26 ` Robert A Duff
2011-07-21 2:37 ` Jeffrey Carter
2011-07-21 9:50 ` Brian Drummond
2011-07-21 14:39 ` Dmitry A. Kazakov
2011-07-23 0:36 ` Randy Brukardt
2011-07-23 9:03 ` Dmitry A. Kazakov
2011-07-23 11:07 ` Simon Wright
2011-07-23 11:21 ` Dmitry A. Kazakov
2011-07-26 21:25 ` Randy Brukardt
2011-07-27 7:45 ` Dmitry A. Kazakov
2011-07-28 0:37 ` Randy Brukardt
2011-07-28 9:22 ` Dmitry A. Kazakov
2011-07-28 14:22 ` Robert A Duff
2011-07-28 14:41 ` Dmitry A. Kazakov
2011-07-28 15:10 ` Robert A Duff
2011-07-28 17:05 ` Dmitry A. Kazakov
2011-07-28 23:32 ` Randy Brukardt
2011-07-28 23:48 ` Randy Brukardt [this message]
2011-07-29 6:57 ` Simon Wright
2011-07-29 18:56 ` Jeffrey Carter
2011-07-30 0:13 ` Randy Brukardt
2011-07-29 7:41 ` Dmitry A. Kazakov
2011-07-30 0:17 ` Randy Brukardt
2011-07-30 8:27 ` Dmitry A. Kazakov
2011-08-01 22:12 ` Randy Brukardt
2011-08-02 10:01 ` Dmitry A. Kazakov
2011-08-02 21:30 ` Randy Brukardt
2011-08-03 9:01 ` Dmitry A. Kazakov
2011-08-03 20:35 ` Randy Brukardt
2011-08-04 8:11 ` Dmitry A. Kazakov
2011-08-05 23:57 ` Randy Brukardt
2011-08-06 8:23 ` Dmitry A. Kazakov
2011-08-08 21:30 ` Randy Brukardt
2011-07-23 14:32 ` Robert A Duff
2011-07-26 21:32 ` Randy Brukardt
2011-07-21 15:28 ` Adam Beneschan
2011-07-21 15:41 ` Robert A Duff
2011-07-21 20:12 ` Adam Beneschan
2011-07-23 0:31 ` Randy Brukardt
2011-07-21 17:40 ` Jeffrey Carter
2011-07-21 21:30 ` Brian Drummond
2011-07-21 21:54 ` Adam Beneschan
2011-07-22 10:16 ` Brian Drummond
2011-07-22 14:54 ` Adam Beneschan
2011-07-23 0:46 ` Randy Brukardt
2011-07-23 0:42 ` Randy Brukardt
2011-07-23 9:20 ` Niklas Holsti
2011-08-04 5:56 ` David Thompson
2011-07-23 9:24 ` Dmitry A. Kazakov
2011-07-23 12:36 ` Brian Drummond
2011-07-21 15:13 ` Robert A Duff
2011-07-23 0:52 ` Randy Brukardt
2011-07-23 14:48 ` Robert A Duff
2011-07-21 14:17 ` anon
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox