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 2002:a24:47c7:: with SMTP id t190-v6mr1972699itb.35.1525761382945; Mon, 07 May 2018 23:36:22 -0700 (PDT) X-Received: by 2002:a9d:5191:: with SMTP id y17-v6mr2754344otg.12.1525761382577; Mon, 07 May 2018 23:36:22 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!paganini.bofh.team!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!u74-v6no154281itb.0!news-out.google.com!f20-v6ni29itd.0!nntp.google.com!u74-v6no154278itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 7 May 2018 23:36:22 -0700 (PDT) In-Reply-To: <87y3gun1ha.fsf@nightsong.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:1206:45c6:8b20:d061:20d7:54ae:2bd7; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 2a02:1206:45c6:8b20:d061:20d7:54ae:2bd7 References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87po2la2qt.fsf@nightsong.com> <87in8buttb.fsf@jacob-sparre.dk> <87wowqpowu.fsf@nightsong.com> <16406268-83df-4564-8855-9bd0fe9caac0@googlegroups.com> <87o9i2pkcr.fsf@nightsong.com> <87in88m43h.fsf@nightsong.com> <87efiuope8.fsf@nightsong.com> <322f9b26-01de-4753-bb50-6ef2f3d993d8@googlegroups.com> <87a7th9pd1.fsf@nightsong.com> <87h8no1nli.fsf@nightsong.com> <87po2cyty7.fsf@nightsong.com> <87bmdwhwob.fsf@nightsong.com> <6746d7d1-406e-4891-8293-9424aed76215@googlegroups.com> <877eoezy6e.fsf@nightsong.com> <87y3gun1ha.fsf@nightsong.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: How to get Ada to ?cross the chasm?? From: gautier_niouzes@hotmail.com Injection-Date: Tue, 08 May 2018 06:36:22 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:52093 Date: 2018-05-07T23:36:22-07:00 List-Id: Le mardi 8 mai 2018 07:46:46 UTC+2, Paul Rubin a =C3=A9crit=C2=A0: > gautier_niouzes@hotmail.com writes: > > https://unzip-ada.sourceforge.io/ ) >=20 > I downloaded this and found: >=20 > 1) the file fizzip.adb didn't compile because it used 'Image in an > improper way in a bunch of places. I found on Stack Overflow that > there's a GNAT attribute 'Img that got it to work. It's corrected in rev. r622: https://sourceforge.net/p/unzip-ada/code/622/ > 2) gprbuild made a zipada program but no unzipada. Unzip is commented > out of the .prj file. Corrected as well in rev. 620: https://sourceforge.net/p/unzip-ada/code/620/ > 3) The bunzip program it builds is around 25% slower than the default > Linux one, which is reasonable if it's safer, i.e. specifically if it's > free of potentially unsafe memory accesses. I heard somewhere that > optimized GNAT turns off subscript checking by default, which seems > un-Ada-like. But, from C++ stdlib containers, I think subscript checks > are cheaper than most people might expect. >=20 > 4) The lzma_enc program it builds runs noticeably faster than=20 > xz --format=3Dlzma, but it also doesn't compress as well, so I suspect th= e > algorithms are similar but the parameters are different. I don't > see a way to set the compression level in the Ada version. I might > experiment with xz's settings to find one that matches lzma_enc. There is no match because I've programmed the MA part of LZMA from scratch. My version is less sophisticated than the original. > I'm very glad that someone implemented those programs in Ada since there > have historically been various bugs in the C versions that allowed code > injection exploits etc. Actually there are probably still obvious bugs waiting around. I found an out-of-range issue (perhaps harmless) in a ~30 years old code: https://sourceforge.net/p/infozip/bugs/49/ Probably professional hackers do find them all the time... Some vulnerabilities in Zip-Ada (archive unpacking side) were detected thro= ugh fuzzing: https://blog.adacore.com/running-american-fuzzy-lop-on-your-ada-code They could be quickly fixed thanks to the exceptions, range checks, validit= y checks, ... > Regarding crossing the chasm, it would sure be nice if Ada (at least > GNAT) were more interoperable with C and C++ on Linux, in the sense of > using the same makefiles and similar command line tools. Ada seems to > want to be in its own world of Gprbuild and .prj files. IMHO using makefiles only would be a regression: you don't need to explain = an Ada compiler about unit dependencies for instance. Anyway you can launch= gprbuild in a makefile.