Sujet : Re: is Vax addressing sane today
De : niklas.holsti (at) *nospam* tidorum.invalid (Niklas Holsti)
Groupes : comp.archDate : 25. Sep 2024, 20:12:50
Autres entêtes
Organisation : Tidorum Ltd
Message-ID : <llj252FdccuU1@mid.individual.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Mozilla Thunderbird
On 2024-09-25 20:30, MitchAlsup1 wrote:
On Wed, 25 Sep 2024 17:07:45 +0000, Michael S wrote:
On Wed, 25 Sep 2024 09:54:17 -0700
Stephen Fuld <sfuld@alumni.cmu.edu.invalid> wrote:
>
On 9/10/2024 1:13 AM, Niklas Holsti wrote:
>
In the Ada case, the ability to declare array types with
programmer- chosen index types with bounded range, such as
range-bounded integers or enumerations, means that the compiler can
avoid indexing checks when the (sub)type of the index is known at
compile time to fit within the index range of the array.
>
I have always liked the idea of variable ranges able to be specified
in the language. Besides the advantages you mentioned, it provides
more human "comprehensibility" (if the ranges are reasonably named)
i.e. better internal documentation, and it makes responding to
specification changes required later in the program life cycle easier
and less error prone, i.e. if the range has to change, you change it
in one place and don't risk missing making the change in some obscure
part of the program you forgot about.
>
>
>
The problem here is that arrays with fixed bounds were common when
Ada was conceived back in the mid 1970s. On general-purpose (as opposed
to embedded) computers they were already much rarer when Ada was shipped
in 1983. By late 1990s arrays with fixed bounds were rare exception
rather than rule.
It sounds like variable ranges (array indexes) would be becoming more
common, also.
Where "variable range" is a variable that is defined to have a
specified range, but from run to run the upper and lower bounds
can be modified without re-compilation.
Ada subtypes can do that, but the underlying type, set at compile time, for example the standard Integer type, will put an upper bound on the range of the subtype. The number of bits in the numbers cannot change without recompilation.
Michael S says that arrays with variable bounds are becoming more common. I assume he means indexable containers, often called vectors. Ada has several such containers in the standard library, all defined as generic in the index subtype, which means that the compiler can check that the type of a vector index is correct.
If a vector is allocated (sized) with a certain (dynamically defined) length, instead of growing element by element, and if that length matches the (dynamically defined) range of the index subtype, the same static checking methods/proofs can be applied as for traditional arrays of fixed size. I think that the current tools don't do that for vector containers by default, but I beliveve they can be persuaded to do it by writing the corresponding preconditions for the indexing operations.
Date | Sujet | # | | Auteur |
5 Sep 24 | is Vax adressing sane today | 336 | | Brett |
5 Sep 24 | Re: is Vax adressing sane today | 324 | | John Dallman |
6 Sep 24 | Re: is Vax adressing sane today | 1 | | Lawrence D'Oliveiro |
6 Sep 24 | Re: is Vax adressing sane today | 322 | | Anton Ertl |
6 Sep 24 | Re: is Vax adressing sane today | 1 | | Lawrence D'Oliveiro |
6 Sep 24 | Re: is Vax adressing sane today | 5 | | MitchAlsup1 |
7 Sep 24 | Re: is Vax adressing sane today | 4 | | Anton Ertl |
7 Sep 24 | Re: is Vax adressing sane today | 3 | | Anton Ertl |
7 Sep 24 | Re: is Vax addressing sane today | 2 | | John Dallman |
7 Sep 24 | Re: is Vax addressing sane today | 1 | | Anton Ertl |
7 Sep 24 | Re: is Vax adressing sane today | 313 | | John Levine |
8 Sep 24 | Re: is Vax adressing sane today | 312 | | Anton Ertl |
8 Sep 24 | Re: is Vax adressing sane today | 304 | | MitchAlsup1 |
8 Sep 24 | Re: is Vax addressing sane today | 303 | | Lawrence D'Oliveiro |
9 Sep 24 | Re: is Vax addressing sane today | 231 | | MitchAlsup1 |
9 Sep 24 | Re: is Vax addressing sane today | 230 | | Brett |
9 Sep 24 | Re: is Vax addressing sane today | 7 | | MitchAlsup1 |
10 Sep 24 | Re: is Vax addressing sane today | 6 | | Niklas Holsti |
11 Sep 24 | Re: is Vax addressing sane today | 1 | | Lawrence D'Oliveiro |
25 Sep 24 | Re: is Vax addressing sane today | 4 | | Stephen Fuld |
25 Sep 24 | Re: is Vax addressing sane today | 3 | | Michael S |
25 Sep 24 | Re: is Vax addressing sane today | 2 | | MitchAlsup1 |
25 Sep 24 | Re: is Vax addressing sane today | 1 | | Niklas Holsti |
10 Sep 24 | Re: is Vax addressing sane today | 222 | | Anton Ertl |
10 Sep 24 | Re: is Vax addressing sane today | 4 | | Michael S |
10 Sep 24 | Re: is Vax addressing sane today | 3 | | Anton Ertl |
10 Sep 24 | Re: is Vax addressing sane today | 1 | | Niklas Holsti |
11 Sep 24 | Re: is Vax addressing sane today | 1 | | Michael S |
11 Sep 24 | Re: is Vax addressing sane today | 7 | | Lawrence D'Oliveiro |
11 Sep 24 | Re: is Vax addressing sane today | 6 | | Michael S |
11 Sep 24 | Re: is Vax addressing sane today | 5 | | David Brown |
11 Sep 24 | Re: is Vax addressing sane today | 2 | | Thomas Koenig |
11 Sep 24 | Re: is Vax addressing sane today | 1 | | David Brown |
11 Sep 24 | Re: is Vax addressing sane today | 2 | | David Schultz |
13 Sep 24 | Re: is Vax addressing sane today | 1 | | David Brown |
11 Sep 24 | Re: is Vax addressing sane today | 5 | | John Levine |
11 Sep 24 | Re: is Vax addressing sane today | 4 | | Thomas Koenig |
11 Sep 24 | Re: is Vax addressing sane today | 2 | | Anton Ertl |
11 Sep 24 | Re: is Vax addressing sane today | 1 | | jseigh |
11 Sep 24 | Re: is Vax addressing sane today | 1 | | John Levine |
20 Sep 24 | Re: is Vax addressing sane today | 205 | | Kent Dickey |
21 Sep 24 | Re: is Vax addressing sane today | 4 | | MitchAlsup1 |
21 Sep 24 | Re: is Vax addressing sane today | 3 | | Lawrence D'Oliveiro |
21 Sep 24 | Re: is Vax addressing sane today | 2 | | MitchAlsup1 |
21 Sep 24 | Re: is Vax addressing sane today | 1 | | Lawrence D'Oliveiro |
21 Sep 24 | Re: is Vax addressing sane today | 4 | | Lawrence D'Oliveiro |
21 Sep 24 | Re: is Vax addressing sane today | 3 | | MitchAlsup1 |
21 Sep 24 | Re: is Vax addressing sane today | 1 | | Niklas Holsti |
21 Sep 24 | Re: is Vax addressing sane today | 1 | | Lawrence D'Oliveiro |
21 Sep 24 | Re: is Vax addressing sane today | 30 | | MitchAlsup1 |
22 Sep 24 | Re: except what, is Vax addressing sane today | 18 | | John Levine |
22 Sep 24 | Re: except what, is Vax addressing sane today | 1 | | Michael S |
22 Sep 24 | Re: except what, is Vax addressing sane today | 8 | | Lawrence D'Oliveiro |
22 Sep 24 | Re: except what, is Vax addressing sane today | 7 | | Chris M. Thomasson |
22 Sep 24 | Re: except what, is Vax addressing sane today | 6 | | MitchAlsup1 |
22 Sep 24 | Re: except what, is Vax addressing sane today | 2 | | Lawrence D'Oliveiro |
22 Sep 24 | Re: except what, is Vax addressing sane today | 1 | | MitchAlsup1 |
22 Sep 24 | Re: except what, is Vax addressing sane today | 1 | | Chris M. Thomasson |
22 Sep 24 | Re: except what, is Vax addressing sane today | 2 | | John Dallman |
22 Sep 24 | Re: except what, is Vax addressing sane today | 1 | | MitchAlsup1 |
22 Sep 24 | Re: except what, is Vax addressing sane today | 5 | | Terje Mathisen |
24 Sep 24 | Re: except what, is Vax addressing sane today | 4 | | Lawrence D'Oliveiro |
24 Sep 24 | Re: except what, is Vax addressing sane today | 3 | | Chris M. Thomasson |
24 Sep 24 | Re: except what, is Vax addressing sane today | 2 | | MitchAlsup1 |
16 Oct 24 | Re: except what, is Vax addressing sane today | 1 | | Chris M. Thomasson |
22 Sep 24 | Re: except what, is Vax addressing sane today | 3 | | Lars Poulsen |
24 Sep 24 | Re: except what, is Vax addressing sane today | 2 | | Lawrence D'Oliveiro |
24 Sep 24 | Re: except what, is Vax addressing sane today | 1 | | Michael S |
22 Sep 24 | Re: is Vax addressing sane today | 7 | | Lawrence D'Oliveiro |
22 Sep 24 | Re: is Vax addressing sane today | 6 | | MitchAlsup1 |
22 Sep 24 | Re: is Vax addressing sane today | 3 | | Lawrence D'Oliveiro |
22 Sep 24 | Re: is Vax addressing sane today | 2 | | MitchAlsup1 |
22 Sep 24 | Re: is Vax addressing sane today | 1 | | Lawrence D'Oliveiro |
22 Sep 24 | Re: is Vax addressing sane today | 2 | | Anton Ertl |
24 Sep 24 | Re: is Vax addressing sane today | 1 | | MitchAlsup1 |
24 Sep 24 | Re: is Vax addressing sane today | 2 | | Stefan Monnier |
24 Sep 24 | Re: is Vax addressing sane today | 1 | | MitchAlsup1 |
25 Sep 24 | Re: is Vax addressing sane today | 1 | | MitchAlsup1 |
12 Oct 24 | Re: is Vax addressing sane today | 1 | | Anton Ertl |
22 Sep 24 | Re: is Vax addressing sane today | 4 | | Thomas Koenig |
24 Sep 24 | Re: is Vax addressing sane today | 3 | | Kent Dickey |
24 Sep 24 | Re: is Vax addressing sane today | 1 | | Bill Findlay |
24 Sep 24 | Re: is Vax addressing sane today | 1 | | Thomas Koenig |
23 Sep 24 | Re: is Vax addressing sane today | 1 | | Stefan Monnier |
23 Sep 24 | Re: is Vax addressing sane today | 161 | | Kent Dickey |
24 Sep 24 | Re: is Vax addressing sane today | 11 | | MitchAlsup1 |
24 Sep 24 | Re: is Vax addressing sane today | 1 | | Lawrence D'Oliveiro |
24 Sep 24 | Re: is Vax addressing sane today | 9 | | Terje Mathisen |
24 Sep 24 | Re: is Vax addressing sane today | 4 | | Michael S |
24 Sep 24 | Re: is Vax addressing sane today | 3 | | Terje Mathisen |
24 Sep 24 | Re: is Vax addressing sane today | 2 | | Michael S |
24 Sep 24 | Re: is Vax addressing sane today | 1 | | MitchAlsup1 |
24 Sep 24 | Re: is Vax addressing sane today | 3 | | Stephen Fuld |
24 Sep 24 | Re: is Vax addressing sane today | 2 | | MitchAlsup1 |
25 Sep 24 | Re: is Vax addressing sane today | 1 | | Stephen Fuld |
12 Oct 24 | Re: is Vax addressing sane today | 1 | | Anton Ertl |
24 Sep 24 | Re: is Vax addressing sane today | 3 | | Terje Mathisen |
29 Sep 24 | Re: is Vax addressing sane today | 1 | | Michael S |
7 Oct 24 | Re: is Vax addressing sane today | 1 | | Kent Dickey |
25 Sep 24 | Re: is Vax addressing sane today | 133 | | MitchAlsup1 |
26 Sep 24 | Re: is Vax addressing sane today | 1 | | MitchAlsup1 |
28 Sep 24 | Re: is Vax addressing sane today | 131 | | Lawrence D'Oliveiro |
28 Sep 24 | Re: is Vax addressing sane today | 3 | | George Neuner |
7 Oct 24 | Re: is Vax addressing sane today | 8 | | Kent Dickey |
12 Oct 24 | Re: is Vax addressing sane today | 2 | | Anton Ertl |
9 Sep 24 | Re: is Vax addressing sane today | 71 | | Anton Ertl |
8 Sep 24 | Re: is Vax adressing sane today | 7 | | Brett |
8 Sep 24 | Re: is Vax adressing sane today | 2 | | MitchAlsup1 |
6 Sep 24 | Re: is Vax adressing sane today | 2 | | MitchAlsup1 |
6 Sep 24 | Re: is Vax adressing sane today | 1 | | Lawrence D'Oliveiro |
6 Sep 24 | Re: is Vax adressing sane today | 8 | | Anton Ertl |