comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: 64-bit unsigned integer?
Date: Thu, 1 Mar 2018 16:23:49 -0600
Date: 2018-03-01T16:23:49-06:00	[thread overview]
Message-ID: <p79uhl$kro$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: p79qhc$7vu$1@gioia.aioe.org

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:p79qhc$7vu$1@gioia.aioe.org...
...
[Answered based on the most recent thinking, but this is a long way from 
done. - RLB]

> Bounded numbers will be a generic package thus you will not be able to 
> intermix differently bounded numbers even if they are semantically same. 
> You will not be able to convert between such types.

Directly, definitely true. Indirectly, probably not true. You can always 
convert to be unbounded integer or to a "machine" integer.

> You will have no literals,

False: all of these package will have literals (and you will be able to add 
them to any private type of yours as well).

> no universal integer expressions,

Universal integer expressions are completely separate from any math issues 
(since they're evaluated as, well, universal integer expressions). One would 
hope these would work (if not, it seems that we have something that needs to 
be fixed).

> no way to pass it to a generic numeric package

That's an advantage, not a disadvantage. (You always say that you hate 
generics anyway, why do you care??)
Ada doesn't have a universal generic formal numeric type, and that a good 
thing -- it would be virtually impossible to reason about the semantics of 
such a type. (Overflow, saturation, or neither? Floating precision/fixed 
precision/exact results? Etc.)

Also, from an implementation perspective, such a thing would make shared 
generics totally unusable (every operation would have to be done in a thunk, 
as the various differences noted above could not be reconciled with the 
usual technique of "use the largest representation"). That makes me against 
it as it represents an existential threat to Janus/Ada.

>, no way to have it as discriminant (large discriminants are useful in some 
>cases)

Thank goodness. The fewer discriminants the better.

The same would be true with array indexing (although you could use it as a 
map key to get a similar effect).

                                 Randy.


  reply	other threads:[~2018-03-01 22:23 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-25 12:30 64-bit unsigned integer? MM
2018-02-25 12:41 ` Dmitry A. Kazakov
2018-02-25 12:54   ` MM
2018-02-25 13:23     ` Dmitry A. Kazakov
2018-02-25 13:59       ` MM
2018-02-25 14:20         ` Dmitry A. Kazakov
2018-02-25 15:34           ` MM
2018-02-25 16:35     ` Jeffrey R. Carter
2018-02-25 16:36 ` Anh Vo
2018-02-25 17:31   ` MM
2018-02-26 23:19     ` Randy Brukardt
2018-02-26 23:33       ` MM
2018-02-28 10:17       ` Paul Rubin
2018-02-28 10:39         ` J-P. Rosen
2018-02-28 10:59           ` Dmitry A. Kazakov
2018-02-28 23:20         ` Randy Brukardt
2018-03-01  5:47           ` Paul Rubin
2018-03-01  8:16             ` Niklas Holsti
2018-03-01  8:35               ` Simon Wright
2018-03-01  8:47               ` Dmitry A. Kazakov
2018-03-01 18:15                 ` Dan'l Miller
2018-03-01 19:10                   ` Dmitry A. Kazakov
2018-03-01 19:22                     ` Dan'l Miller
2018-03-01 19:59                       ` Dmitry A. Kazakov
2018-03-01 20:32                         ` Dan'l Miller
2018-03-01 21:15                           ` Dmitry A. Kazakov
2018-03-01 22:23                             ` Randy Brukardt [this message]
2018-03-01 23:50                             ` Robert Eachus
2018-03-01 20:06                     ` Niklas Holsti
2018-03-01 22:04               ` Randy Brukardt
2018-02-26  6:45 ` Robert Eachus
2018-02-27 16:40   ` Dan'l Miller
2018-02-27 17:18     ` J-P. Rosen
2018-02-27 18:17       ` Dan'l Miller
2018-02-28  3:03         ` Robert Eachus
2018-02-28  6:41         ` J-P. Rosen
replies disabled

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