comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: ANN: Ada/SPARK ASN.1 implementation version 0.0.01
Date: Mon, 1 Aug 2016 12:47:34 -0700
Date: 2016-08-01T12:47:34-07:00	[thread overview]
Message-ID: <nno90n$5pj$1@dont-email.me> (raw)
In-Reply-To: <3ac0fbcd-1f1c-40b8-b030-de03954f894f@googlegroups.com>

On 08/01/2016 01:15 AM, Shark8 wrote:
> 
> I would certainly appropriate comments, criticism, and most especially contributions.

I took a look at the big-number pkg, and have the following suggestions:

If you want people to contribute to this effort, I'd suggest you use a coding
style more similar to that used in the ARM. You might also want to learn how to
spell "negative".

I don't see why it's desirable to specify the representation of the non-variable
parts of Big_Number.

I'd think it would be a good idea for code like this to be portable, in which
case it should avoid optional types such as Long_Long_Integer, and certainly not
assume it knows that it's 64 bits.

While it's unlikely to be an issue on modern processors, given your constant

Base : constant := 2 ** System.Word_Size;

there's no guarantee that declarations

type Digit is range 0 .. Base;

type Double_Digit is mod Base ** 2;

will be accepted. A more portable approach, and one which maximizes the size of
the digits used, is

type Double_Digit is mod System.Max_Binary_Modulus;

Digit_Size : constant := Double_Digit'Size / 2;

type Digit is mod Digit_Size;

This is the approach used by PragmARC.Unbounded_Integers.

HTH.

-- 
Jeff Carter
"We burst our pimples at you."
Monty Python & the Holy Grail
16

  parent reply	other threads:[~2016-08-01 19:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01  8:15 ANN: Ada/SPARK ASN.1 implementation version 0.0.01 Shark8
2016-08-01  8:16 ` Shark8
2016-08-01  8:51 ` Dmitry A. Kazakov
2016-08-01 16:18   ` Shark8
2016-08-01 18:37     ` Dmitry A. Kazakov
2016-08-01 19:47 ` Jeffrey R. Carter [this message]
2016-08-01 21:55   ` Shark8
2016-08-01 22:14     ` Randy Brukardt
2016-08-01 23:46       ` Shark8
2016-08-01 23:42     ` Jeffrey R. Carter
2016-08-01 23:53       ` Shark8
2016-08-02  0:29         ` Jeffrey R. Carter
2016-08-02  9:01 ` ttsiodras
2016-08-02 18:47   ` p.p11
2016-08-03  7:13     ` ttsiodras
replies disabled

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