comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Lower bounds of Strings
Date: Fri, 8 Jan 2021 10:04:21 +0100	[thread overview]
Message-ID: <rt976j$qbd$1@gioia.aioe.org> (raw)
In-Reply-To: rt80g8$6sf$1@franka.jacob-sparre.dk

On 2021-01-07 23:03, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:rt6ltg$922$1@gioia.aioe.org...
> ...
>> No, one should have interfaces for such operations as well.
> 
> You're again losing sight of the ultimate goal here, which is to have a
> conventionally compiled language that works close to the metal for high
> performance. (And is compatible with embedded systems, runable from ROM,
> etc.)
> 
> Interfaces of any kind are completely counter to that goal, *especially* in
> the case of arrays/vector containers.

Ada 83 achieved that goal easily while having most of array interfaces 
implemented. The missing interfaces were subarrays and planes of 
multidimensional arrays and proper types of index ranges.

> Any sort of multiple inheritance (not to mention multiple dispatch) requires
> searching a lookup table for the appropriate interface. That is unaccepably
> expensive for an operation as basic as array indexing. One could use
> just-in-time compilation and similar techniques to reduce those costs, but
> those sort of things are not usable in a ROM environment and are much more
> appropriate for a language like Python.

You are talking here about having run-time classes of array types and 
dynamic dispatch on them. That is another story.

[ Though Ada was not shy of introducing ugly tagged iterators, if one 
can do one, why not another? ]

> If you aren't using the interface as such (that is, with some form of
> dispatching), then it is simply a complication with no semantic meaning.

The semantic meaning is defining operations of the type has and the 
class it belongs. With arrays you need that because there are lots of 
type conversions between array and array-related types. Interface is 
mere formalization what can be converted into what. You need that 
regardless the method you implement arrays.

The point is that you cannot throw that away without making your 
containers totally useless, you will end up with the notorious 
"Pascal-arrays" pretty soon.

> So either you are talking about a complication without value, or an
> extremely expensive implementation that doesn't meet the goals for a
> language like Ada. What's the point?

It was not expensive in Ada 83. Speaking of the goals, the goal is to 
have user-defined arrays intermixeable with the built-in ones.

> BTW, you have yet to show me any useful example that you can't reasonably do
> with a bounded vector (assuming that vector supports any discrete index
> type).

About 90% of anything is not possible in the existing form. Without 
slices you must pass arrays bounds (or offset/length) down to each call 
as in C.

+ 100% of bindings are impossible.

>> You cannot do that with a single type and single dispatch.
> 
> Exactly my point. The implementation of multiple inheritance and multiple
> dispatch is simply too expensive for a language like Ada, and that's
> especially true in the case of basic building blocks like arrays/vectors.

Remember, we are talking about static cases. Your containers with or 
without generics cannot do dynamic dispatch. So everything is static, 
thus, voilà, it costs nothing.

The problem I see is not performance costs, but the fact nobody know how 
to implement multiple dispatch consistently.

> The language you want is not feasible to implement IMHO. A language without
> a feasible implementation doesn't exist practically, and there's little
> sense in talking about it.

I am pretty much satisfied with Ada 83 arrays. What I want is compiler 
magic open to user-defined types. You propose to kill the first without 
offering the second.

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

  reply	other threads:[~2021-01-08  9:04 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 11:04 Lower bounds of Strings Stephen Davies
2021-01-05 11:57 ` Dmitry A. Kazakov
2021-01-05 12:32   ` Jeffrey R. Carter
2021-01-05 13:40     ` Dmitry A. Kazakov
2021-01-05 14:31       ` Stephen Davies
2021-01-05 17:24         ` Stephen Davies
2021-01-05 18:28           ` Jeffrey R. Carter
2021-01-05 21:02             ` Stephen Davies
2021-01-07 10:38               ` Stephen Davies
2021-01-07 21:39                 ` Randy Brukardt
2021-01-07 22:38                   ` Stephen Davies
2021-01-05 12:24 ` Luke A. Guest
2021-01-05 12:49 ` Simon Wright
2021-01-05 12:51 ` Jeffrey R. Carter
2021-01-06  3:08 ` Randy Brukardt
2021-01-06  9:13   ` Dmitry A. Kazakov
2021-01-07  0:17     ` Randy Brukardt
2021-01-07  9:57       ` Dmitry A. Kazakov
2021-01-07 22:03         ` Randy Brukardt
2021-01-08  9:04           ` Dmitry A. Kazakov [this message]
2021-01-08 17:23           ` Shark8
2021-01-08 20:19             ` Dmitry A. Kazakov
2021-01-09  2:18               ` Randy Brukardt
2021-01-09 10:53                 ` Dmitry A. Kazakov
2021-01-12  8:19                   ` Randy Brukardt
2021-01-12  9:37                     ` Dmitry A. Kazakov
2021-01-09  2:31             ` Randy Brukardt
2021-01-09 14:52               ` Why UTF-8 (was Re: Lower bounds of Strings) Jeffrey R. Carter
2021-01-09 18:08                 ` Dmitry A. Kazakov
2021-01-12  7:58                   ` Randy Brukardt
2021-01-11 21:35               ` Lower bounds of Strings Shark8
2021-01-12  8:12                 ` Randy Brukardt
2021-01-12 20:51                   ` Shark8
2021-01-12 22:56                     ` Randy Brukardt
2021-01-13 12:00                       ` Dmitry A. Kazakov
2021-01-13 13:27                         ` AdaMagica
2021-01-13 13:53                           ` Dmitry A. Kazakov
2021-01-13 14:08                   ` Jeffrey R. Carter
2021-01-14 11:38 ` AdaMagica
2021-01-14 12:27   ` Dmitry A. Kazakov
2021-01-14 13:31   ` AdaMagica
2021-01-14 14:02   ` Jeffrey R. Carter
2021-01-14 14:34     ` Dmitry A. Kazakov
2021-01-14 15:28       ` Shark8
2021-01-14 15:41         ` Dmitry A. Kazakov
2021-01-19 21:02           ` G.B.
2021-01-19 22:27             ` Dmitry A. Kazakov
2021-01-20 20:10               ` G.B.
2021-01-20 20:25                 ` Dmitry A. Kazakov
2021-01-15 10:24   ` Stephen Davies
2021-01-15 11:41     ` J-P. Rosen
2021-01-15 17:35       ` Stephen Davies
2021-01-15 19:36         ` Egil H H
2021-01-16 12:57           ` Stephen Davies
2021-01-17 14:10         ` Stephen Davies
2021-01-19  5:48           ` Randy Brukardt
2021-01-19  6:13         ` Gautier write-only address
2021-01-15 11:48     ` Jeffrey R. Carter
2021-01-15 13:34       ` Dmitry A. Kazakov
2021-01-15 13:56       ` Stephen Davies
2021-01-15 15:12         ` Jeffrey R. Carter
2021-01-15 17:22           ` Stephen Davies
2021-01-15 21:10             ` Jeffrey R. Carter
2021-01-15 14:00       ` Stephen Davies
2021-01-16  9:30     ` G.B.
2021-01-16 13:13       ` Stephen Davies
replies disabled

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