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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Sun, 29 Apr 2018 07:58:34 -0700 Organization: A noiseless patient Spider Message-ID: <87bme2oy91.fsf@nightsong.com> References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87k1su7nag.fsf@nightsong.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="2973c66b8467d5e5c38d149f2cdfa94b"; logging-data="11565"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Gl4dUbqxLumodrAMQSFW+" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:npviGmdWjPkkMOb6AEWzMmTnPGs= sha1:k2cuXBWmV2k+nzs1zX2ZEzegLBo= Xref: reader02.eternal-september.org comp.lang.ada:51795 Date: 2018-04-29T07:58:34-07:00 List-Id: "Jeffrey R. Carter" writes: > Of course, you should be able to write complex systems without a lot > of attention, and your style should have no constraints on it at all. The idea, of course, is to let the machine do more of the work since it's better at mindless and repetitive tasks than humans are. Plus, you can work more productively by focusing your attention on your actual problem instead of on that low level stuff. > The biggest constraint on style is having to use those finicky control > structures instead of just having conditional gotos It's the other way around. You're constrained from using HOFs and immutable data that are simple to reason about, instead of finicky control structures and other low-level manipulation that it's far preferable to leave to the compiler. I looked at the Ada solution to https://rosettacode.org/wiki/Hamming_numbers and the person missed the whole point of the problem, which is to use a sane algorithm. And yet they still around about 5x as much code as the "classic" Haskell solution, and their program crashed from integer overflow for n=1692. They posted code for n=1000000 that used a bignum package, but they didn't show the answer, and they must not have tested the code because it never would have finished (it would have had to count up to around 5e83).