Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Hackers of the world, unite!


devel / comp.lang.ada / New aggregates with Ada 2022.

SubjectAuthor
* New aggregates with Ada 2022.Blady
+* Re: New aggregates with Ada 2022.Simon Wright
|`* Re: New aggregates with Ada 2022.Blady
| `- Re: New aggregates with Ada 2022.Simon Wright
+* Re: New aggregates with Ada 2022.Randy Brukardt
|`* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| +* Re: New aggregates with Ada 2022.Randy Brukardt
| |`* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| | `* Re: New aggregates with Ada 2022.Randy Brukardt
| |  `* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| |   +* Re: New aggregates with Ada 2022.G.B.
| |   |`- Re: New aggregates with Ada 2022.Randy Brukardt
| |   `* Re: New aggregates with Ada 2022.Randy Brukardt
| |    `* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| |     `* Re: New aggregates with Ada 2022.Randy Brukardt
| |      `* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| |       `* Re: New aggregates with Ada 2022.Randy Brukardt
| |        +* Re: New aggregates with Ada 2022.Niklas Holsti
| |        |`* Re: New aggregates with Ada 2022.Randy Brukardt
| |        | `* Re: New aggregates with Ada 2022.Jeffrey R.Carter
| |        |  +* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| |        |  |`* Re: New aggregates with Ada 2022.Randy Brukardt
| |        |  | `- Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| |        |  `* Re: New aggregates with Ada 2022.Niklas Holsti
| |        |   +* Re: New aggregates with Ada 2022.Jeffrey R.Carter
| |        |   |`- Re: New aggregates with Ada 2022.Randy Brukardt
| |        |   `* Re: New aggregates with Ada 2022.Randy Brukardt
| |        |    +* Re: New aggregates with Ada 2022.Marius Amado-Alves
| |        |    |`- Re: New aggregates with Ada 2022.Randy Brukardt
| |        |    `* Re: New aggregates with Ada 2022.Jeffrey R.Carter
| |        |     `* Re: New aggregates with Ada 2022.Marius Amado-Alves
| |        |      `* Re: New aggregates with Ada 2022.Jeffrey R.Carter
| |        |       `- Re: New aggregates with Ada 2022.Marius Amado-Alves
| |        `* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| |         `* Re: New aggregates with Ada 2022.Randy Brukardt
| |          `* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
| |           `- Re: New aggregates with Ada 2022.Randy Brukardt
| `* Re: New aggregates with Ada 2022.Randy Brukardt
|  `* Re: New aggregates with Ada 2022.Dmitry A. Kazakov
|   `* Re: New aggregates with Ada 2022.Randy Brukardt
|    `- Re: New aggregates with Ada 2022.Dmitry A. Kazakov
`* Re: New aggregates with Ada 2022.Jesper Quorning
 `* Re: New aggregates with Ada 2022.Jesper Quorning
  `- Re: New aggregates with Ada 2022.Randy Brukardt

Pages:12
New aggregates with Ada 2022.

<t8ml0l$1vo2$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8420&group=comp.lang.ada#8420

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!PAH2WLQzsO9hmEab7f6scg.user.46.165.242.75.POSTED!not-for-mail
From: p.p11@orange.fr (Blady)
Newsgroups: comp.lang.ada
Subject: New aggregates with Ada 2022.
Date: Sun, 19 Jun 2022 09:59:16 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t8ml0l$1vo2$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="65282"; posting-host="PAH2WLQzsO9hmEab7f6scg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.9.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Blady - Sun, 19 Jun 2022 07:59 UTC

Hello,

Following the example section of RM Ada 2022 § 4.3.5 Container
Aggregate, I want to try map aggregates:

453. type Map_Type is private
454. with Aggregate => (Empty => Empty_Map,
455. Add_Named => Add_To_Map);
456.
457. procedure Add_To_Map (M : in out Map_Type; Key : in Integer;
Value : in String);
458.
459. Empty_Map : constant Map_Type;
.... -- End of example code
482. private
....
488. type Map_Type is array (1..10) of String (1..10);
489.
490. procedure Add_To_Map (M : in out Map_Type; Key : in Integer;
Value : in String) is null;
491. Empty_Map : constant Map_Type := (1..10 => (1..10 => ' '));

GNAT 12 reports:

aarm_202x_ch04.adb:491:40: error: container aggregate must use [], not ()
aarm_202x_ch04.adb:491:42: error: choice must be static

The first error seems to say that even Map_Type full view is known in
the private part I can't use assignment with genuine array aggregates.
It is a legal feature or GNAT is puzzled?
Is there an other mean to assign array aggregates?

I can't really figure out the meaning of the second error.
Any idea?

Thanks Pascal.

Re: New aggregates with Ada 2022.

<lytu8gyc17.fsf@pushface.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8421&group=comp.lang.ada#8421

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!gXCTzWgngy6wN83KUtm4Jg.user.46.165.242.75.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Sun, 19 Jun 2022 15:15:48 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lytu8gyc17.fsf@pushface.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="23418"; posting-host="gXCTzWgngy6wN83KUtm4Jg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:rk7ie6Z/hWlIua5A016AVBYerqY=
 by: Simon Wright - Sun, 19 Jun 2022 14:15 UTC

Blady <p.p11@orange.fr> writes:

> aarm_202x_ch04.adb:491:40: error: container aggregate must use [], not ()

If you look at ARM202x 4.3.5, you'll see that *container* aggregates
must use []. I'm sure there wa a whole lot of argument about this in the
ARG!

Re: New aggregates with Ada 2022.

<t8qi8h$14re$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8422&group=comp.lang.ada#8422

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!asLUhd0B7lqVMVZUsq4kzQ.user.46.165.242.75.POSTED!not-for-mail
From: p.p11@orange.fr (Blady)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Mon, 20 Jun 2022 21:36:49 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t8qi8h$14re$1@gioia.aioe.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <lytu8gyc17.fsf@pushface.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="37742"; posting-host="asLUhd0B7lqVMVZUsq4kzQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.9.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Blady - Mon, 20 Jun 2022 19:36 UTC

Le 19/06/2022 à 16:15, Simon Wright a écrit :
> Blady <p.p11@orange.fr> writes:
>
>> aarm_202x_ch04.adb:491:40: error: container aggregate must use [], not ()
>
> If you look at ARM202x 4.3.5, you'll see that *container* aggregates
> must use []. I'm sure there wa a whole lot of argument about this in the
> ARG!

Yes I was aware of that but I wanted to give Empty_Map its real value of
the full type definition.

My understanding is:
you declare the aggregate aspect as:
type Map_Type is private
with Aggregate => (Empty => Empty_Map,
Add_Named => Add_To_Map);
thus:
MM : Map_Type;
....
MM := [] -- the compiler uses Empty_Map
MM := [1=>"toto", 4=>"titi"]; -- the compiler uses Add_To_Map

now if I declare:
Empty_Map : constant Map_Type := [];
then it could be an recursive infinite call, could be?

Note : in this latter case the compiler issues a ICE:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106031

Re: New aggregates with Ada 2022.

<t8qptm$gof$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8424&group=comp.lang.ada#8424

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Mon, 20 Jun 2022 16:47:32 -0500
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <t8qptm$gof$2@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org>
Injection-Date: Mon, 20 Jun 2022 21:47:34 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="58ae5e8bcd39845de9e7a19af4c1f4e0";
logging-data="17167"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18M2Qsqw8avy8ExRVM4ee6jtdTc1C249sk="
Cancel-Lock: sha1:vywXNRTvqaH67bguZE0KVEUancs=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Mon, 20 Jun 2022 21:47 UTC

"Blady" <p.p11@orange.fr> wrote in message
news:t8ml0l$1vo2$1@gioia.aioe.org...
> Hello,
>
> Following the example section of RM Ada 2022 � 4.3.5 Container Aggregate,
> I want to try map aggregates:
>
> 453. type Map_Type is private
> 454. with Aggregate => (Empty => Empty_Map,
> 455. Add_Named => Add_To_Map);
> 456.
> 457. procedure Add_To_Map (M : in out Map_Type; Key : in Integer;
> Value : in String);
> 458.
> 459. Empty_Map : constant Map_Type;
> ... -- End of example code
> 482. private
> ...
> 488. type Map_Type is array (1..10) of String (1..10);

This type is illegal, by 4.3.5(10/5):

If the container type of an Aggregate aspect is a private type, the full
type of the container type shall not be an array type.

The reason for this is obvious in your question: it is ambiguous if an
aggregate is an array aggregate or a container aggregate wherever the full
type is visible, and that is not worth making work (any choice would be a
surprise in some contexts).

Apparently, GNAT failed to check for this error (probably because there
aren't ACATS tests yet for Ada 2022, so errors of omission are very hard to
find, not having a vetted set of tests).

Secondly, early post Ada 2022 AIs have removed the possibility of using a
constant for Empty_Map, since it does nto work with inheritance (and
container aggregates are supposed to work with inheritance). So while GNAT
may allow you to define Empty_Map this way now, it won't for very long. It
will need to be a function.

Randy.

Re: New aggregates with Ada 2022.

<lypmj3xad6.fsf@pushface.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8425&group=comp.lang.ada#8425

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!gXCTzWgngy6wN83KUtm4Jg.user.46.165.242.75.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Mon, 20 Jun 2022 23:01:41 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lypmj3xad6.fsf@pushface.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <lytu8gyc17.fsf@pushface.org>
<t8qi8h$14re$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="16086"; posting-host="gXCTzWgngy6wN83KUtm4Jg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:IjaUeySJSFVcuLO12efawRDRa+g=
 by: Simon Wright - Mon, 20 Jun 2022 22:01 UTC

Blady <p.p11@orange.fr> writes:

> Le 19/06/2022 à 16:15, Simon Wright a écrit :
>> Blady <p.p11@orange.fr> writes:
>>
>>> aarm_202x_ch04.adb:491:40: error: container aggregate must use [], not ()
>> If you look at ARM202x 4.3.5, you'll see that *container* aggregates
>> must use []. I'm sure there wa a whole lot of argument about this in the
>> ARG!
>
> Yes I was aware of that but I wanted to give Empty_Map its real value
> of the full type definition.
>
> My understanding is:
> you declare the aggregate aspect as:
> type Map_Type is private
> with Aggregate => (Empty => Empty_Map,
> Add_Named => Add_To_Map);
> thus:
> MM : Map_Type;
> ...
> MM := [] -- the compiler uses Empty_Map
> MM := [1=>"toto", 4=>"titi"]; -- the compiler uses Add_To_Map
>
> now if I declare:
> Empty_Map : constant Map_Type := [];
> then it could be an recursive infinite call, could be?

I think you'd need to supply the contents - Empty_Map here is presumably
the full declaration (it is in your PR). Fixing this, the compiler is
still confused (it thinks that 'others' in [others => [others => ' ']]
isn't static - also if replaced by '1 .. 10'!!!).

Re: New aggregates with Ada 2022.

<c0c74e8d-ca63-4afb-b07a-b88f18cf7114n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8426&group=comp.lang.ada#8426

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a5d:514d:0:b0:21b:932b:be77 with SMTP id u13-20020a5d514d000000b0021b932bbe77mr4355600wrt.231.1655763050518;
Mon, 20 Jun 2022 15:10:50 -0700 (PDT)
X-Received: by 2002:a0d:e084:0:b0:314:b0c:5dc2 with SMTP id
j126-20020a0de084000000b003140b0c5dc2mr28682920ywe.411.1655763049891; Mon, 20
Jun 2022 15:10:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 20 Jun 2022 15:10:49 -0700 (PDT)
In-Reply-To: <t8ml0l$1vo2$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=194.255.97.108; posting-account=hMbstgoAAAAIa4kxFYtvUVUHbE1RcZzT
NNTP-Posting-Host: 194.255.97.108
References: <t8ml0l$1vo2$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c0c74e8d-ca63-4afb-b07a-b88f18cf7114n@googlegroups.com>
Subject: Re: New aggregates with Ada 2022.
From: jesper.quorning@gmail.com (Jesper Quorning)
Injection-Date: Mon, 20 Jun 2022 22:10:50 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Jesper Quorning - Mon, 20 Jun 2022 22:10 UTC

It look like the Aggregate aspect has some rough edges.
This code leads to internal compiler error with gnatmake 12.1.0:

package Container_Aggregates is
type Array_Type is
array (1 .. 10) of Integer
with Aggregate => (Empty => Empty_Array);

Empty_Array : constant Array_Type := [1..10 => 123];
end Container_Aggregates;

Re: New aggregates with Ada 2022.

<t8qrmo$p79$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8427&group=comp.lang.ada#8427

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!l6SSJpCTNdcdYkpTNEWC9Q.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Tue, 21 Jun 2022 00:18:01 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t8qrmo$p79$1@gioia.aioe.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="25833"; posting-host="l6SSJpCTNdcdYkpTNEWC9Q.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Mon, 20 Jun 2022 22:18 UTC

On 2022-06-20 23:47, Randy Brukardt wrote:

> The reason for this is obvious in your question: it is ambiguous if an
> aggregate is an array aggregate or a container aggregate wherever the full
> type is visible, and that is not worth making work (any choice would be a
> surprise in some contexts).

I don't agree that making the language regular does not worth work. The
choice is obviously inconsistent with handling both existing cases:

1. Built-in operations -> hiding:

type T is private;
function "+" (Left, Right : T) return T; -- Perfectly legal
private
type T is range 1..100;

2. Primitive operations -> overriding.

What's good for the goose is good for the gander? Nope. Here is a
totally new way of handling an operation!

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

Re: New aggregates with Ada 2022.

<9e3aa56d-42b3-4552-8027-908403118721n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8428&group=comp.lang.ada#8428

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a5d:4d12:0:b0:21b:88ac:9250 with SMTP id z18-20020a5d4d12000000b0021b88ac9250mr12773777wrt.136.1655765992061;
Mon, 20 Jun 2022 15:59:52 -0700 (PDT)
X-Received: by 2002:a25:33c6:0:b0:648:b8a1:a30e with SMTP id
z189-20020a2533c6000000b00648b8a1a30emr28017111ybz.44.1655765991569; Mon, 20
Jun 2022 15:59:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 20 Jun 2022 15:59:51 -0700 (PDT)
In-Reply-To: <c0c74e8d-ca63-4afb-b07a-b88f18cf7114n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=194.255.97.108; posting-account=hMbstgoAAAAIa4kxFYtvUVUHbE1RcZzT
NNTP-Posting-Host: 194.255.97.108
References: <t8ml0l$1vo2$1@gioia.aioe.org> <c0c74e8d-ca63-4afb-b07a-b88f18cf7114n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9e3aa56d-42b3-4552-8027-908403118721n@googlegroups.com>
Subject: Re: New aggregates with Ada 2022.
From: jesper.quorning@gmail.com (Jesper Quorning)
Injection-Date: Mon, 20 Jun 2022 22:59:52 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Jesper Quorning - Mon, 20 Jun 2022 22:59 UTC

tirsdag den 21. juni 2022 kl. 00.10.52 UTC+2 skrev Jesper Quorning:
> This code leads to internal compiler error with gnatmake 12.1.0:

This is the bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106037
The crash happens another place than the #106031 report by Blady.

I ran into a third ICE with erroneous memory access while playing around with an access type.

/Jesper

Re: New aggregates with Ada 2022.

<t8tjnb$m2n$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8431&group=comp.lang.ada#8431

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Tue, 21 Jun 2022 18:20:10 -0500
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <t8tjnb$m2n$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <c0c74e8d-ca63-4afb-b07a-b88f18cf7114n@googlegroups.com> <9e3aa56d-42b3-4552-8027-908403118721n@googlegroups.com>
Injection-Date: Tue, 21 Jun 2022 23:20:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3943c1bd97a1959445a9f71f871aed17";
logging-data="22615"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YzAQZj8f4lrhT/JTiZ/lScTg9D2XpCNI="
Cancel-Lock: sha1:4mqqeR2Eva75fVpb7qU0Ci2YlPo=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Tue, 21 Jun 2022 23:20 UTC

Thia ia also illegal: the aspect aggregate is defined "for a type other than
an array type", so the aspect should not even be recognized in this context.

Randy.

"Jesper Quorning" <jesper.quorning@gmail.com> wrote in message
news:9e3aa56d-42b3-4552-8027-908403118721n@googlegroups.com...
> tirsdag den 21. juni 2022 kl. 00.10.52 UTC+2 skrev Jesper Quorning:
>> This code leads to internal compiler error with gnatmake 12.1.0:
>
> This is the bug report:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106037
> The crash happens another place than the #106031 report by Blady.
>
> I ran into a third ICE with erroneous memory access while playing around
> with an access type.
>
>
> /Jesper

Re: New aggregates with Ada 2022.

<t8tk6i$ue6$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8432&group=comp.lang.ada#8432

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Tue, 21 Jun 2022 18:28:17 -0500
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <t8tk6i$ue6$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me> <t8qrmo$p79$1@gioia.aioe.org>
Injection-Date: Tue, 21 Jun 2022 23:28:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3943c1bd97a1959445a9f71f871aed17";
logging-data="31174"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wvbgUfP7wH00K1MkiqtoNasm5zXWA8IA="
Cancel-Lock: sha1:FtIi9x9xPOJ/4TqlkJdJv8EO1lk=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Tue, 21 Jun 2022 23:28 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:t8qrmo$p79$1@gioia.aioe.org...
> On 2022-06-20 23:47, Randy Brukardt wrote:
>
>> The reason for this is obvious in your question: it is ambiguous if an
>> aggregate is an array aggregate or a container aggregate wherever the
>> full
>> type is visible, and that is not worth making work (any choice would be a
>> surprise in some contexts).
>
> I don't agree that making the language regular does not worth work.

There's always a way, but is it worth the implementation effort? And would
it be confusing to use?

> The choice is obviously inconsistent with handling both existing cases:
>
> 1. Built-in operations -> hiding:
>
> type T is private;
> function "+" (Left, Right : T) return T; -- Perfectly legal
> private
> type T is range 1..100;

This case is not worth the effort, IMHO. (Of course, it is in the language
now, so we're stuck with it.) If I was running the circus, private types
could only be completed with a record type. 99% of the time, that's what you
want. And the other 1% of the time, you will eventually end up changing it
into a record for one reason or the other. So why pollute the language rules
for something primarily useful in ACATS tests?

> 2. Primitive operations -> overriding.
>
> What's good for the goose is good for the gander? Nope. Here is a totally
> new way of handling an operation!

The problem here is illustrated by the OP, who seemed to expect to get the
container aggregate when the full view is visible. We looked at making the
container aggregate invisible and allowing the array aggregate in the full
view, but it would be something new (the contents of aggregates don't depend
on visibility in Ada 2012), and it seems useless (see my answer to [1]).

That is, the OPs construct is primarily useful in small examples; it's not a
real world thing you would want to do. (There ALWAYS is some other data that
you need to go along with an array: a length, a validity flag, etc.) So why
make implementers spend a lot of effort implementing it??

Randy.

Re: New aggregates with Ada 2022.

<t8tks0$aad$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8433&group=comp.lang.ada#8433

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Tue, 21 Jun 2022 18:39:43 -0500
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <t8tks0$aad$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me> <t8qrmo$p79$1@gioia.aioe.org>
Injection-Date: Tue, 21 Jun 2022 23:39:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3943c1bd97a1959445a9f71f871aed17";
logging-data="10573"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zezZrmglDpP5FTBYAolX+Y7/Tg0ZN7nE="
Cancel-Lock: sha1:anJYfg2geoysbTRzJ5KM0epzi6Q=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Tue, 21 Jun 2022 23:39 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:t8qrmo$p79$1@gioia.aioe.org...
....
> 1. Built-in operations -> hiding:
>
> type T is private;
> function "+" (Left, Right : T) return T; -- Perfectly legal
> private
> type T is range 1..100;
>
> 2. Primitive operations -> overriding.

BTW, these two are really the same thing. In the first example, the "+" is
overriding the predefined operation.

But note an important difference here from the aggregate case: in no case is
an operation available for the private type that is *not* available for the
full view. Since the syntax and semantics of container aggregates and array
aggregate are subtly different (they are as close as we could make them, but
that is not that close), there definitely are things that would be only
possible when written for the private view. That would be new for Ada. So
while a definition could be made, it would be confusing in some cases. And
this case isn't useful enough to make that effort.

BTW2, there are many things in Ada that would be possible with effort but
are illegal for one reason or another. Part of the reason for doing that is
that it is always possible to allow such things in the future -- that would
be a compatible change. OTOH, defining them sloppily would leave us stuck
forever with an expensive and relatively useless feature. For instance, the
rather strict limitations on the use and contents of a declare expression
fall into that category. Allowing more would be possible, but it would have
far-reaching effects on compilers and on the language definition. Not worth
the cost at this point, perhaps that will change.

Randy.
..

Re: New aggregates with Ada 2022.

<t8ujnr$1hvf$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8435&group=comp.lang.ada#8435

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Wed, 22 Jun 2022 10:26:34 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t8ujnr$1hvf$1@gioia.aioe.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
<t8qrmo$p79$1@gioia.aioe.org> <t8tks0$aad$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="51183"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Wed, 22 Jun 2022 08:26 UTC

On 2022-06-22 01:39, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:t8qrmo$p79$1@gioia.aioe.org...
> ...
>> 1. Built-in operations -> hiding:
>>
>> type T is private;
>> function "+" (Left, Right : T) return T; -- Perfectly legal
>> private
>> type T is range 1..100;
>>
>> 2. Primitive operations -> overriding.
>
> BTW, these two are really the same thing. In the first example, the "+" is
> overriding the predefined operation.

Yes, they should be in a better world. A primitive operation is always
reachable. The case above works differently from:

type T is private;
overriding
function "+" (Left, Right : T) return T is abstract;

But this is a deeper problem of having such operations primitive.

> But note an important difference here from the aggregate case: in no case is
> an operation available for the private type that is *not* available for the
> full view. Since the syntax and semantics of container aggregates and array
> aggregate are subtly different (they are as close as we could make them, but
> that is not that close), there definitely are things that would be only
> possible when written for the private view. That would be new for Ada. So
> while a definition could be made, it would be confusing in some cases. And
> this case isn't useful enough to make that effort.

Much could be resolved by attributing proper types to all assumed or
real intermediate steps:

type T is private;
function "+" (Left, Right : T) return T;
private
type T_Parent is range 1..100;
type T is new T_Parent;

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

Re: New aggregates with Ada 2022.

<t8ulu9$jca$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8436&group=comp.lang.ada#8436

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Wed, 22 Jun 2022 11:04:09 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t8ulu9$jca$1@gioia.aioe.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
<t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="19850"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Wed, 22 Jun 2022 09:04 UTC

On 2022-06-22 01:28, Randy Brukardt wrote:

> This case is not worth the effort, IMHO. (Of course, it is in the language
> now, so we're stuck with it.) If I was running the circus, private types
> could only be completed with a record type.

Just like aggregates now, record types *must* have interface. Your
"circus" will inevitable face this same problem again - how to define
record members of a private type implemented by a built-in record type
in the full view? The language must universally handle all sorts of
interfaces.

> The problem here is illustrated by the OP, who seemed to expect to get the
> container aggregate when the full view is visible. We looked at making the
> container aggregate invisible and allowing the array aggregate in the full
> view, but it would be something new (the contents of aggregates don't depend
> on visibility in Ada 2012), and it seems useless (see my answer to [1]).

I would first answer basic questions, which interfaces have array vs
user-defined aggregate/index. How are they related to each other etc.

> That is, the OPs construct is primarily useful in small examples; it's not a
> real world thing you would want to do. (There ALWAYS is some other data that
> you need to go along with an array: a length, a validity flag, etc.) So why
> make implementers spend a lot of effort implementing it??

Well, I can give a useful example straight away. A string has two array
interfaces, the encoding and the character view. The former must be a
built-in array.

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

Re: New aggregates with Ada 2022.

<t90ebe$nve$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8438&group=comp.lang.ada#8438

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Wed, 22 Jun 2022 20:06:53 -0500
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <t90ebe$nve$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me> <t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me> <t8ulu9$jca$1@gioia.aioe.org>
Injection-Date: Thu, 23 Jun 2022 01:06:55 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3391b7818b792a0e7a169185c1208738";
logging-data="24558"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XRSMx4PVXNY0/wvwBcbK/YQPf2Y5TkAo="
Cancel-Lock: sha1:hv5hnB/130zcgLJlYtUMtw/3CQI=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Thu, 23 Jun 2022 01:06 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:t8ulu9$jca$1@gioia.aioe.org...
> On 2022-06-22 01:28, Randy Brukardt wrote:
....
> Well, I can give a useful example straight away. A string has two array
> interfaces, the encoding and the character view. The former must be a
> built-in array.

The interface for a string should be quite different from that for an array,
they're not related at all. One might implement a string with a record type
that has an array component, but never as a bare array. (That leads to
nonsense, which Ada sadly has proven clearly.

Indeed, if you consider everything to have an interface, arrays themselves
cease to be a fundemental part of a language design and just become another
interface. (How something gets implemented should not be part of a language
design, so long as the design does not prevent an efficient implementation.)
I certainly would not treat them as special in any way, just a series of
function calls. (Possibly records could be treated that way as well,
although it is less clear that an efficient implementation is possible for
them.)

Randy.

Randy.

Re: New aggregates with Ada 2022.

<t90ehf$p2t$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8439&group=comp.lang.ada#8439

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Wed, 22 Jun 2022 20:10:06 -0500
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <t90ehf$p2t$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me> <t8qrmo$p79$1@gioia.aioe.org> <t8tks0$aad$1@dont-email.me> <t8ujnr$1hvf$1@gioia.aioe.org>
Injection-Date: Thu, 23 Jun 2022 01:10:08 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3391b7818b792a0e7a169185c1208738";
logging-data="25693"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dMwpj9iWmlyABDqqFNdzNXwfpa0mFdho="
Cancel-Lock: sha1:MR+R297p2vOsm6O9q70lHmIokhI=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Thu, 23 Jun 2022 01:10 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:t8ujnr$1hvf$1@gioia.aioe.org...
> On 2022-06-22 01:39, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:t8qrmo$p79$1@gioia.aioe.org...
>> ...
>>> 1. Built-in operations -> hiding:
>>>
>>> type T is private;
>>> function "+" (Left, Right : T) return T; -- Perfectly legal
>>> private
>>> type T is range 1..100;
>>>
>>> 2. Primitive operations -> overriding.
>>
>> BTW, these two are really the same thing. In the first example, the "+"
>> is
>> overriding the predefined operation.
>
> Yes, they should be in a better world. A primitive operation is always
> reachable. The case above works differently from:
>
> type T is private;
> overriding
> function "+" (Left, Right : T) return T is abstract;
>
> But this is a deeper problem of having such operations primitive.
>
>> But note an important difference here from the aggregate case: in no case
>> is
>> an operation available for the private type that is *not* available for
>> the
>> full view. Since the syntax and semantics of container aggregates and
>> array
>> aggregate are subtly different (they are as close as we could make them,
>> but
>> that is not that close), there definitely are things that would be only
>> possible when written for the private view. That would be new for Ada. So
>> while a definition could be made, it would be confusing in some cases.
>> And
>> this case isn't useful enough to make that effort.
>
> Much could be resolved by attributing proper types to all assumed or real
> intermediate steps:
>
> type T is private;
> function "+" (Left, Right : T) return T;
> private
> type T_Parent is range 1..100;
> type T is new T_Parent;

Don't think this changes anything (at least not in Ada as it stands), since
that is essentially the meaning of "range 1 .. 100":

type Some_Int is range 1 .. 100;

means

type Some_Int is new <Some_Int_Chosen_by_the_Impl> range 1 .. 100;

Randy.

Re: New aggregates with Ada 2022.

<t91buq$10im$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8440&group=comp.lang.ada#8440

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Thu, 23 Jun 2022 11:32:11 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t91buq$10im$1@gioia.aioe.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
<t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me>
<t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="33366"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Thu, 23 Jun 2022 09:32 UTC

On 2022-06-23 03:06, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:t8ulu9$jca$1@gioia.aioe.org...
>> On 2022-06-22 01:28, Randy Brukardt wrote:
> ...
>> Well, I can give a useful example straight away. A string has two array
>> interfaces, the encoding and the character view. The former must be a
>> built-in array.
>
> The interface for a string should be quite different from that for an array,
> they're not related at all. One might implement a string with a record type
> that has an array component, but never as a bare array. (That leads to
> nonsense, which Ada sadly has proven clearly.

String is an array of encoding units, historically and practically. Even
at the machine level string instructions deal with arrays.

A language unable to support such implementation does not look usable to me.

> Indeed, if you consider everything to have an interface, arrays themselves
> cease to be a fundemental part of a language design and just become another
> interface.

Everything has interface just because it is the way human brain works.

The language design question is what interfaces deserve to be formalized
and exposed in the language as entities the programmer can reference,
check against etc.

In Ada array interface is exposed in generics as a formal array, but not
in the type system proper.

In any case having an explicit array interface does not preclude
built-in arrays.

> (How something gets implemented should not be part of a language
> design, so long as the design does not prevent an efficient implementation.)
> I certainly would not treat them as special in any way, just a series of
> function calls. (Possibly records could be treated that way as well,
> although it is less clear that an efficient implementation is possible for
> them.)

Syntax sugar for subprogram calls is not enough because it does not
allow generic programming. One should be able to write a program that
deals with any instance of the interface. Like a generic body working
with any actual array or a class-wide body which unfortunately is
impossible to have for arrays presently.

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

Re: New aggregates with Ada 2022.

<t91bvr$10im$2@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8441&group=comp.lang.ada#8441

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Thu, 23 Jun 2022 11:32:44 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t91bvr$10im$2@gioia.aioe.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
<t8qrmo$p79$1@gioia.aioe.org> <t8tks0$aad$1@dont-email.me>
<t8ujnr$1hvf$1@gioia.aioe.org> <t90ehf$p2t$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="33366"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Thu, 23 Jun 2022 09:32 UTC

On 2022-06-23 03:10, Randy Brukardt wrote:

> Don't think this changes anything (at least not in Ada as it stands), since
> that is essentially the meaning of "range 1 .. 100":
>
> type Some_Int is range 1 .. 100;
>
> means
>
> type Some_Int is new <Some_Int_Chosen_by_the_Impl> range 1 .. 100;

I mean that then we would have two distinct types to assign conflicting
operations to. So "+" each goes to a separate type.

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

Re: New aggregates with Ada 2022.

<t91gmo$rh1$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8442&group=comp.lang.ada#8442

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bauhaus@notmyhomepage.invalid (G.B.)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Thu, 23 Jun 2022 12:53:12 +0200
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <t91gmo$rh1$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
<t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me>
<t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me>
<t91buq$10im$1@gioia.aioe.org>
Reply-To: nonlegitur@notmyhomepage.de
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 23 Jun 2022 10:53:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d693f7f922fab079e7262433f7db058b";
logging-data="28193"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XED6H/R4SRB2Ho6rpMgC7zTPmE2h9v5o="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.10.0
Cancel-Lock: sha1:zlBR5ttQCGg+7IMEJj17YriQcoU=
In-Reply-To: <t91buq$10im$1@gioia.aioe.org>
Content-Language: en-US
 by: G.B. - Thu, 23 Jun 2022 10:53 UTC

On 23.06.22 11:32, Dmitry A. Kazakov wrote:

> In any case having an explicit array interface does not preclude built-in arrays.

Indeed, if there were no built-in arrays, how would one

- specify aspects like "contiguous memory",
- permit implementations to create efficient addressing
for arrays' storage units
- map to hardware?

Re: New aggregates with Ada 2022.

<t933i7$n6g$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8443&group=comp.lang.ada#8443

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Thu, 23 Jun 2022 20:21:09 -0500
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <t933i7$n6g$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me> <t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me> <t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me> <t91buq$10im$1@gioia.aioe.org> <t91gmo$rh1$1@dont-email.me>
Injection-Date: Fri, 24 Jun 2022 01:21:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="719d095f426b37c49cffae3fe5625499";
logging-data="23760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19F97r7T7VDI62gWskt5MX+Zambr3kQVts="
Cancel-Lock: sha1:iSMVW166LX888VxXZ74rLy4ZTNY=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Fri, 24 Jun 2022 01:21 UTC

"G.B." <bauhaus@notmyhomepage.invalid> wrote in message
news:t91gmo$rh1$1@dont-email.me...
> On 23.06.22 11:32, Dmitry A. Kazakov wrote:
>
>> In any case having an explicit array interface does not preclude built-in
>> arrays.
>
> Indeed, if there were no built-in arrays, how would one
>
> - specify aspects like "contiguous memory",
> - permit implementations to create efficient addressing
> for arrays' storage units
> - map to hardware?

With aspects, of course, that are part of the "interface". Why do you think
that one needs a visible built-in array in order to support these (or any
other) operations?

Again, at the implementation level, surely there is some sort of built-in
array. But one does not need to expose that at the programmer level.
"Efficient addressing" is the compiler's job, it will do whatever makes
sense for the target (and those vary quite a bit).

For example, "contiguous" is an aspect that Ada is missing (but should
have). Implementations should have the freedom to pick any implementation in
the absence of such as aspect (which should be rarely needed, mainly for
interfacing with hardware and foreign software).

Mapping to hardware could be handled with a "fixed vector" container (one
that would be rarely used other than for interfacing). It doesn't require an
array, just something with the right semantics.

Randy.

Re: New aggregates with Ada 2022.

<t933oh$o2o$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8444&group=comp.lang.ada#8444

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Thu, 23 Jun 2022 20:24:32 -0500
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <t933oh$o2o$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me> <t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me> <t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me> <t91buq$10im$1@gioia.aioe.org>
Injection-Date: Fri, 24 Jun 2022 01:24:34 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="719d095f426b37c49cffae3fe5625499";
logging-data="24664"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ro2QmADuJ3dM5rYh+6GiNpjLn8FVUSvQ="
Cancel-Lock: sha1:OffEvhrR9jNLSA+rXe9C185R9Vg=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Fri, 24 Jun 2022 01:24 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:t91buq$10im$1@gioia.aioe.org...
> On 2022-06-23 03:06, Randy Brukardt wrote:
....
>> (How something gets implemented should not be part of a language
>> design, so long as the design does not prevent an efficient
>> implementation.)
>> I certainly would not treat them as special in any way, just a series of
>> function calls. (Possibly records could be treated that way as well,
>> although it is less clear that an efficient implementation is possible
>> for
>> them.)
>
> Syntax sugar for subprogram calls is not enough because it does not allow
> generic programming. One should be able to write a program that deals with
> any instance of the interface. Like a generic body working with any actual
> array or a class-wide body which unfortunately is impossible to have for
> arrays presently.

You're thinking too small. Obviously, in a language without an syntactic
array construct, every data structure would be some sort of record. So
class-wide operations would be available for all of those -- and without all
of the complications of a separate formal array type. The idea is to have
one mechanism for pretty much everything, and let the compiler sort out the
results. Back when we created Janus/Ada, that wasn't really practical
because of memory and CPU speed constraints, but none of that holds true
anymore. Simplify the language, complicate the compiler!

Randy.

Re: New aggregates with Ada 2022.

<t93mr6$pvm$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8445&group=comp.lang.ada#8445

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Fri, 24 Jun 2022 08:50:14 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t93mr6$pvm$1@gioia.aioe.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
<t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me>
<t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me>
<t91buq$10im$1@gioia.aioe.org> <t933oh$o2o$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="26614"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Fri, 24 Jun 2022 06:50 UTC

On 2022-06-24 03:24, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:t91buq$10im$1@gioia.aioe.org...
>> On 2022-06-23 03:06, Randy Brukardt wrote:
> ...
>>> (How something gets implemented should not be part of a language
>>> design, so long as the design does not prevent an efficient
>>> implementation.)
>>> I certainly would not treat them as special in any way, just a series of
>>> function calls. (Possibly records could be treated that way as well,
>>> although it is less clear that an efficient implementation is possible
>>> for
>>> them.)
>>
>> Syntax sugar for subprogram calls is not enough because it does not allow
>> generic programming. One should be able to write a program that deals with
>> any instance of the interface. Like a generic body working with any actual
>> array or a class-wide body which unfortunately is impossible to have for
>> arrays presently.
>
> You're thinking too small. Obviously, in a language without an syntactic
> array construct, every data structure would be some sort of record.

They are fundamentally different. Record interface is static mapping:

identifier -> value

1D array interface is dynamic mapping:

ordered value -> value

It not only has run-time semantics of (indexing). It is also ordering of
the index which implies enumeration, ranges, slices.

> So
> class-wide operations would be available for all of those -- and without all
> of the complications of a separate formal array type. The idea is to have
> one mechanism for pretty much everything, and let the compiler sort out the
> results. Back when we created Janus/Ada, that wasn't really practical
> because of memory and CPU speed constraints, but none of that holds true
> anymore. Simplify the language, complicate the compiler!

I don't buy the idea of run-time penalty for having abstract data types
and I don't see why built-in arrays cannot coexist with user-defined
ones without turning the language into LISP. Furthermore, the age of
free CPU cycles came to an end. Soon we will have return back to sanity.

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

Re: New aggregates with Ada 2022.

<t95uha$edq$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8450&group=comp.lang.ada#8450

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Fri, 24 Jun 2022 22:13:44 -0500
Organization: A noiseless patient Spider
Lines: 85
Message-ID: <t95uha$edq$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me> <t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me> <t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me> <t91buq$10im$1@gioia.aioe.org> <t933oh$o2o$1@dont-email.me> <t93mr6$pvm$1@gioia.aioe.org>
Injection-Date: Sat, 25 Jun 2022 03:13:46 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ea8ee915547ce677c25b93936a1e0f4c";
logging-data="14778"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IqpiTZ0ME9mU3ytLCog7n2po+/3ghTxg="
Cancel-Lock: sha1:L2QO4pqTw6vVfIQMs7jHiW2EtIw=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
X-MSMail-Priority: Normal
 by: Randy Brukardt - Sat, 25 Jun 2022 03:13 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:t93mr6$pvm$1@gioia.aioe.org...
> On 2022-06-24 03:24, Randy Brukardt wrote:
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
>> news:t91buq$10im$1@gioia.aioe.org...
>>> On 2022-06-23 03:06, Randy Brukardt wrote:
>> ...
>>>> (How something gets implemented should not be part of a language
>>>> design, so long as the design does not prevent an efficient
>>>> implementation.)
>>>> I certainly would not treat them as special in any way, just a series
>>>> of
>>>> function calls. (Possibly records could be treated that way as well,
>>>> although it is less clear that an efficient implementation is possible
>>>> for
>>>> them.)
>>>
>>> Syntax sugar for subprogram calls is not enough because it does not
>>> allow
>>> generic programming. One should be able to write a program that deals
>>> with
>>> any instance of the interface. Like a generic body working with any
>>> actual
>>> array or a class-wide body which unfortunately is impossible to have for
>>> arrays presently.
>>
>> You're thinking too small. Obviously, in a language without an syntactic
>> array construct, every data structure would be some sort of record.
>
> They are fundamentally different. Record interface is static mapping:
>
> identifier -> value
>
> 1D array interface is dynamic mapping:
>
> ordered value -> value
>
> It not only has run-time semantics of (indexing). It is also ordering of
> the index which implies enumeration, ranges, slices.

Dymanic means a function. And there is no reason to treat a few functions as
special (again, at the user level).

Something purely-compile time (like the selection of record components)
clearly needs some special semantics. Not so clear with dynamic things.

>> So
>> class-wide operations would be available for all of those -- and without
>> all
>> of the complications of a separate formal array type. The idea is to have
>> one mechanism for pretty much everything, and let the compiler sort out
>> the
>> results. Back when we created Janus/Ada, that wasn't really practical
>> because of memory and CPU speed constraints, but none of that holds true
>> anymore. Simplify the language, complicate the compiler!
>
> I don't buy the idea of run-time penalty for having abstract data types
> and I don't see why built-in arrays cannot coexist with user-defined ones
> without turning the language into LISP.

They add a huge amount of complication for very little gain. One could
simplify them (getting rid of mistaken features like slices), but you still
would want a user-defined version. And once you have that, you no longer
need a special version - you just have some predefined versions (just like
Ada handles operators).

> Furthermore, the age of free CPU cycles came to an end. Soon we will have
> return back to sanity.

I don't think programming abstractly and translating that into good code
will ever be a bad idea. After all, that is the idea behind Ada. If you
truly want to worry about the cost of compilation, then you have program in
a very close to the metal language, even lower level than C. And current
machines are way harder to generate code for than the Z-80 that we started
out on (and even then, we generated pretty bad code with the very tiny
compiler).

I'd rather plan for a future where the compiler tool set does a lot of
correctness checking for one's programs; code generation will always be much
cheaper than that (especially if you do not need bleeding edge performance).
Simplify (and abstract) the language, complicate the compiler!

Randy.

Re: New aggregates with Ada 2022.

<t96i9f$1mc1$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8455&group=comp.lang.ada#8455

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Sat, 25 Jun 2022 10:50:54 +0200
Organization: Aioe.org NNTP Server
Message-ID: <t96i9f$1mc1$1@gioia.aioe.org>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
<t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me>
<t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me>
<t91buq$10im$1@gioia.aioe.org> <t933oh$o2o$1@dont-email.me>
<t93mr6$pvm$1@gioia.aioe.org> <t95uha$edq$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="55681"; posting-host="siG8trSPtxwtkBCOZpBn8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Sat, 25 Jun 2022 08:50 UTC

On 2022-06-25 05:13, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:t93mr6$pvm$1@gioia.aioe.org...
>> On 2022-06-24 03:24, Randy Brukardt wrote:

>>> You're thinking too small. Obviously, in a language without an syntactic
>>> array construct, every data structure would be some sort of record.
>>
>> They are fundamentally different. Record interface is static mapping:
>>
>> identifier -> value
>>
>> 1D array interface is dynamic mapping:
>>
>> ordered value -> value
>>
>> It not only has run-time semantics of (indexing). It is also ordering of
>> the index which implies enumeration, ranges, slices.
>
> Dymanic means a function. And there is no reason to treat a few functions as
> special (again, at the user level).

No. Identifier is not a value, it is a static name. This allows us to
have any statically chosen type on the right side of the mapping.

With a dynamic mapping we must have the same type for all outcomes, e.g.
of the array element.

>> I don't buy the idea of run-time penalty for having abstract data types
>> and I don't see why built-in arrays cannot coexist with user-defined ones
>> without turning the language into LISP.
>
> They add a huge amount of complication for very little gain.

We have different priorities here. I see arrays with slices as one of
the most important language features. Especially considering formal
verification and validation.

>> Furthermore, the age of free CPU cycles came to an end. Soon we will have
>> return back to sanity.
>
> I don't think programming abstractly and translating that into good code
> will ever be a bad idea. After all, that is the idea behind Ada. If you
> truly want to worry about the cost of compilation, then you have program in
> a very close to the metal language, even lower level than C. And current
> machines are way harder to generate code for than the Z-80 that we started
> out on (and even then, we generated pretty bad code with the very tiny
> compiler).

No, I worry about cost of execution. You want to simplify the compiler
at the expense of the program complexity and efficiency of its code.

> I'd rather plan for a future where the compiler tool set does a lot of
> correctness checking for one's programs;

Yes and correctness checking requires proper and very refined
abstractions you are ready to throw away. Here is a contradiction. In a
language like Forth there is basically nothing to check.

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

Re: New aggregates with Ada 2022.

<t9d7u5$ogle$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8457&group=comp.lang.ada#8457

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Mon, 27 Jun 2022 16:37:08 -0500
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <t9d7u5$ogle$1@dont-email.me>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me> <t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me> <t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me> <t91buq$10im$1@gioia.aioe.org> <t933oh$o2o$1@dont-email.me> <t93mr6$pvm$1@gioia.aioe.org> <t95uha$edq$1@dont-email.me> <t96i9f$1mc1$1@gioia.aioe.org>
Injection-Date: Mon, 27 Jun 2022 21:37:10 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="af6f7f353385d44805f8f5f1d83c5664";
logging-data="803502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18byO9HyBKcupOcLWwgzPxlau2hXv3z2i8="
Cancel-Lock: sha1:ckVWKrwB9laIpwKuy/dwadCVdQ8=
X-Priority: 3
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-MSMail-Priority: Normal
 by: Randy Brukardt - Mon, 27 Jun 2022 21:37 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:t96i9f$1mc1$1@gioia.aioe.org...
> On 2022-06-25 05:13, Randy Brukardt wrote:
....
>> I don't think programming abstractly and translating that into good code
>> will ever be a bad idea. After all, that is the idea behind Ada. If you
>> truly want to worry about the cost of compilation, then you have program
>> in
>> a very close to the metal language, even lower level than C. And current
>> machines are way harder to generate code for than the Z-80 that we
>> started
>> out on (and even then, we generated pretty bad code with the very tiny
>> compiler).
>
> No, I worry about cost of execution. You want to simplify the compiler at
> the expense of the program complexity and efficiency of its code.

I think we strongly agree here. I want to simplify the front-end to
strengthen abstractions, and so that the effort can be put where it belongs,
on static analysis/optimization and on code generation. These things are
mostly fancy pattern matching, and the more of it that you can do, the
better. Time spent implementing features that don't increase the expressive
power (or worse, compilicate code generation in all cases) is
counter-productive.

>> I'd rather plan for a future where the compiler tool set does a lot of
>> correctness checking for one's programs;
>
> Yes and correctness checking requires proper and very refined abstractions
> you are ready to throw away. Here is a contradiction. In a language like
> Forth there is basically nothing to check.

Slices are not an abstraction. They are a way to describe a particular kind
of processor operation in a vaguely abstract way. But they don't extend to
user-defined structures or even multi-dimensional maps (arrays if you
prefer) in any practical way. The distributed overhead that they cause is
immense (for instance, you can't have a discontigious array represesentation
with slices, unless you are willing to pay a substantial cost for *every*
array parameter). They're the anti-abstraction feature.

Randy.

Re: New aggregates with Ada 2022.

<jhviamFe72sU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8459&group=comp.lang.ada#8459

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.lang.ada
Subject: Re: New aggregates with Ada 2022.
Date: Tue, 28 Jun 2022 08:36:21 +0300
Organization: Tidorum Ltd
Lines: 18
Message-ID: <jhviamFe72sU1@mid.individual.net>
References: <t8ml0l$1vo2$1@gioia.aioe.org> <t8qptm$gof$2@dont-email.me>
<t8qrmo$p79$1@gioia.aioe.org> <t8tk6i$ue6$1@dont-email.me>
<t8ulu9$jca$1@gioia.aioe.org> <t90ebe$nve$1@dont-email.me>
<t91buq$10im$1@gioia.aioe.org> <t933oh$o2o$1@dont-email.me>
<t93mr6$pvm$1@gioia.aioe.org> <t95uha$edq$1@dont-email.me>
<t96i9f$1mc1$1@gioia.aioe.org> <t9d7u5$ogle$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net onqX7FruQkea4HoU0IhSigTC+Sg//93ki2dluklVF6OZ1QsGHN
Cancel-Lock: sha1:0I5F0oII1GqGnbNbDsVoaE7yXpA=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0)
Gecko/20100101 Thunderbird/91.9.1
Content-Language: en-US
In-Reply-To: <t9d7u5$ogle$1@dont-email.me>
 by: Niklas Holsti - Tue, 28 Jun 2022 05:36 UTC

On 2022-06-28 0:37, Randy Brukardt wrote:
>
> Slices are not an abstraction. They are a way to describe a particular kind
> of processor operation in a vaguely abstract way.

The abstraction is the concept of a one-dimensional array (a vector or a
sequence). Slicing such an object -- taking a subsequence -- seems a
very natural operation to me, even on the abstraction level.

> The distributed overhead that they [slices] cause is immense (for
> instance, you can't have a discontigious array represesentation with
> slices,

Why would you want to have a non-contiguous representation for
one-dimensional arrays? Perhaps to make "unbounded" (extensible) arrays?


devel / comp.lang.ada / New aggregates with Ada 2022.

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor