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.107.170.159 with SMTP id g31mr3171844ioj.4.1474742331902; Sat, 24 Sep 2016 11:38:51 -0700 (PDT) X-Received: by 10.157.46.197 with SMTP id w63mr570668ota.12.1474742331877; Sat, 24 Sep 2016 11:38:51 -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!u18no4005968ita.0!news-out.google.com!w143ni11441itb.0!nntp.google.com!u18no4005966ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 24 Sep 2016 11:38:51 -0700 (PDT) In-Reply-To: <0dbca7f0-791b-4eee-99fa-ce5fe2a71de6@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=80.113.36.20; posting-account=wg42bwoAAAAkdsXrFOhcNSrdlVzaFnf1 NNTP-Posting-Host: 80.113.36.20 References: <52cfa89e-7e4f-48f6-93b4-d559ea001d82@googlegroups.com> <87oa3ph71j.fsf@adaheads.sparre-andersen.dk> <0dbca7f0-791b-4eee-99fa-ce5fe2a71de6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2d49e17f-c57e-451e-a506-96f963b3cf61@googlegroups.com> Subject: Re: feedback asked on dab-decoder software in Ada From: jan van katwijk Injection-Date: Sat, 24 Sep 2016 18:38:51 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31877 Date: 2016-09-24T11:38:51-07:00 List-Id: Op zaterdag 24 september 2016 19:45:26 UTC+2 schreef jan van katwijk: > Op donderdag 15 september 2016 11:00:10 UTC+2 schreef Jacob Sparre Anders= en: > > Jan van Katwijk wrote: > >=20 > > > This summer I wanted to learn Ada (again, after a period of well over > > > 20 years) and I made a reimplementation of the DAB software in Ada. > >=20 > > Sounds like an ambitious project. > >=20 > > > I would like to get some feedback on the use of the Ada language. > >=20 > > Some comments and questions: > >=20 > > + It would make it easier to get contributions from other Ada > > developers, if you switched source style to something closer > > to what is suggested by the Ada Quality and Style Guide [1]. > >=20 > > + Why do you put the package specifications in a separate directory? > >=20 > > + You might benefit from running your compiler with more warnings > > enabled. > >=20 > > + A package body doesn't have to "with" itself. > >=20 > > + There are no guarantees that "Integer" in Ada is the same as "int" in > > C. If you need a C "int", you should use "Interfaces.C.int". > >=20 > > + Are you sure you need as many access types as you declare? (It looks > > - understandably - a bit like you are writing C in Ada.) > >=20 > > + It looks like you aren't getting as much out of the type system as yo= u > > could. (A length should probably not be able to contain negative > > values. - Just to take a single example.) > >=20 > > > Any feedback and suggestions for improvement (it definitely runs > > > slower than the C++ version) is welcome > >=20 > > I would suggest that you postpone the performance improvements a bit, > > and focus on getting more out of Ada. > >=20 > > Greetings, > >=20 > > Jacob > >=20 > > [1] http://www.adaic.org/resources/add_content/docs/95style/html/cover.= html > > --=20 > > "For there are only two reasons why war is made against a > > republic: The one, to become lord over her: the other, the > > fear of being occupied by her." -- Nicolo Machiavelli >=20 > Thanks for the comments. In the meantime I tried to apply some guideline = rules, and the gnat compiler does not complain anymore on the layout. > Wrt identifiers: I am not impressed very much by the guidelines, to me Is= _Running is not better readable than isRunning, Has_Property not than hasPr= operty. >=20 > First of all: the ada implementation of DAB is derived from the existing = C++ implementation, all algorithms were extensively tried and tested in C++= , so the complexity was more on using C libraries (I use several C librarie= s), some of them with callbacks. That all went pretty smooth, however, hand= ling the GUI turned out to be more difficult than hndling the much more com= plex GUI in C++ (GtkAda vs Qt)=20 >=20 > The code and coding style is obviously influenced by having programmed in= C++ for the last 10 years. Wrt access types, I really have to look at it, = most likely it follows from the C++ background. >=20 > Anyway, thanks for the advices, I'll continue to make it more "Ada-style" >=20 > jan I looked into the abundant use of access types. In the front end (i.e. the = ofdm processing part) some access varaibles could be eliminated and replace= d by "normal" variables. In the backend, however, quite some dynamic choice= s determine which part of the program should be active (e.g. MP2 decoding o= r MP4 decoding). jan