From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.157.42.34 with SMTP id t31mr51433426ota.36.1470088529779; Mon, 01 Aug 2016 14:55:29 -0700 (PDT) X-Received: by 10.157.47.97 with SMTP id h88mr218770otb.10.1470088529750; Mon, 01 Aug 2016 14:55:29 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!f6no6585893ith.0!news-out.google.com!d68ni14026ith.0!nntp.google.com!f6no6569573ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 1 Aug 2016 14:55:29 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.161.1.175; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 75.161.1.175 References: <3ac0fbcd-1f1c-40b8-b030-de03954f894f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: ANN: Ada/SPARK ASN.1 implementation version 0.0.01 From: Shark8 Injection-Date: Mon, 01 Aug 2016 21:55:29 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:31242 Date: 2016-08-01T14:55:29-07:00 List-Id: 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.