From: Shark8 <onewingedshark@gmail.com>
Subject: Re: ANN: Ada/SPARK ASN.1 implementation version 0.0.01
Date: Mon, 1 Aug 2016 14:55:29 -0700 (PDT)
Date: 2016-08-01T14:55:29-07:00 [thread overview]
Message-ID: <cd2d5a71-69f3-4521-b43d-845dcce053f1@googlegroups.com> (raw)
In-Reply-To: <nno90n$5pj$1@dont-email.me>
On Monday, August 1, 2016 at 1:47:39 PM UTC-6, Jeffrey R. Carter wrote:
> 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".
Corrected spelling.
Also, "coding style" should **NOT** be an issue -- it is a testament to the CS industry being stunted that it is an issue. (The 'primary' store of source should be within meaningful structures, likely in a DB, not plain=text.)
> 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.
Agreed -- however this *is* the 0.0.01 release, and not intended to be the be-all/end-all of source code. (Again, collaboration is welcome.)
> 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.
Thank you for the pointers.
next prev parent reply other threads:[~2016-08-01 21:55 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
2016-08-01 21:55 ` Shark8 [this message]
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