comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Proposal: Auto-allocation of Indefinite Objects
Date: Sun, 23 Aug 2020 14:28:21 +0200	[thread overview]
Message-ID: <rhtnd3$u89$1@gioia.aioe.org> (raw)
In-Reply-To: rhssmf$as6$1@franka.jacob-sparre.dk

On 23/08/2020 06:52, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:rhnqip$bga$1@gioia.aioe.org...
>> On 21/08/2020 01:33, Randy Brukardt wrote:
>>> "Dennis Lee Bieber" <wlfraed@ix.netcom.com> wrote in message
>>> news:mkmtjflufgmatkk3hp25nvk2hoogun1fis@4ax.com...
>>>> On Thu, 20 Aug 2020 19:49:44 +0200, "Dmitry A. Kazakov"
>>>> <mailbox@dmitry-kazakov.de> declaimed the following:
>>>>
>>>>>
>>>>> But records and arrays are needed as building blocks of containers. How
>>>>> would you get rid of them?
>>>>
>>>> And likely needed for any embedded or low-level work where they are
>>>> mapped to things like (GP) I/O ports or such...
>>>
>>> Yes, a fixed vector container would be needed for interfacing (probably
>>> wouldn't use it for anything else). But there's no reason that can't be
>>> provided as a container, so long as representation guarentees (esp.
>>> Component_Size) are included. Remember that containers (in Ada 202x) have
>>> indexing, aggregates, and all of the useful basic operations. The stuff
>>> that's missing is the same stuff that adds a vast amount of complexity to
>>> Ada (and possibilities for bugs) - hardly anyone would miss it.
>>
>> Really? I would miss array conversions, slices, equivalence of same length
>> index ranges, constrained array subtypes etc.
> 
> Those things are mostly useful for making work for programmers. Note that
> I'm assuming that Strings are a completely separate abstraction - a UTF-8
> string is not an array and shouldn't be treated as one. (Indexing of
> individual characters being very expensive.)

That is an implementation detail of a given representation. String of 
any encoding is an array of characters per definition of string.

> Fixed constrained arrays would
> be available for interfacing (they're not really useful for much else).

I would say it is exactly the opposite. Unconstrained arrays are not 
very useful because the operation of changing array length is very rare 
and very expensive (applying your logic).

In most cases a fixed array does the work. Note that among the remaining 
cases, the majority are ones where bounds are still fixed but Ada does 
not support proper initialization or proper aggregation of. The 
remainder of that is very small.

That small part could, again, be covered by bounded arrays, as you 
suggested in another post, if Ada supported propagation of constraints 
in a more effective way than literal discriminants. Presently bounded 
arrays are practically useless because the place where you must specify 
the bounds is never the place where you can determine them.

> Note
> that a bounded vector is allocated statically, so there's no extra cost to
> using it (unlike an unbounded vector or string).

Maybe, but since there will be arrays anyway, why should I suffer 
dealing with messy generics?

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

  reply	other threads:[~2020-08-23 12:28 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 22:48 Proposal: Auto-allocation of Indefinite Objects Stephen Davies
2020-04-03 23:45 ` Stephen Leake
2020-04-04 10:54   ` Jeffrey R. Carter
2020-04-04 20:55     ` Stephen Davies
2020-04-04  8:31 ` Dmitry A. Kazakov
2020-07-27  7:47 ` Yannick Moy
2020-07-27  9:21   ` J-P. Rosen
2020-07-27  9:49     ` Dmitry A. Kazakov
2020-07-27 17:48   ` Brian Drummond
2020-07-27 20:02     ` Dmitry A. Kazakov
2020-07-28 14:28       ` Brian Drummond
2020-07-28 14:59         ` Dmitry A. Kazakov
2020-07-29 15:33           ` Brian Drummond
2020-07-29 16:20             ` Dmitry A. Kazakov
2020-07-30 13:37               ` Stephen Davies
2020-07-30 14:23                 ` Dmitry A. Kazakov
2020-07-30 17:04               ` Brian Drummond
2020-07-30 18:28                 ` Dmitry A. Kazakov
2020-08-10  0:39                   ` Randy Brukardt
2020-08-10  8:57                     ` Dmitry A. Kazakov
2020-08-20  0:10                       ` Randy Brukardt
2020-08-20 17:49                         ` Dmitry A. Kazakov
2020-08-20 20:19                           ` Dennis Lee Bieber
2020-08-20 23:33                             ` Randy Brukardt
2020-08-21  6:45                               ` Dmitry A. Kazakov
2020-08-23  4:52                                 ` Randy Brukardt
2020-08-23 12:28                                   ` Dmitry A. Kazakov [this message]
2020-08-20 23:30                           ` Randy Brukardt
2020-08-21  6:46                             ` Dmitry A. Kazakov
2020-08-23  4:48                               ` Randy Brukardt
2020-08-23 12:29                                 ` Dmitry A. Kazakov
2020-08-10  0:31               ` Randy Brukardt
2020-08-10  8:58                 ` Dmitry A. Kazakov
2020-08-20  0:13                   ` Randy Brukardt
2020-08-20 17:49                     ` Dmitry A. Kazakov
2020-08-20 23:25                       ` Randy Brukardt
2020-08-21  7:08                         ` Dmitry A. Kazakov
2020-08-23  5:03                           ` Randy Brukardt
2020-08-23 12:28                             ` Dmitry A. Kazakov
2020-07-27 20:31     ` Jeffrey R. Carter
2020-07-31  9:25 ` Stephen Davies
2020-07-31 10:20   ` Dmitry A. Kazakov
2020-08-01 11:22     ` Stephen Davies
2020-08-01 12:58       ` Dmitry A. Kazakov
2020-08-01 20:35         ` Stephen Davies
2020-08-01 20:56           ` Dmitry A. Kazakov
2020-09-03  4:30 ` linda white
replies disabled

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