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: Wed, 02 May 2018 17:25:38 -0700 Organization: A noiseless patient Spider Message-ID: <8736z9bn5p.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> <87in88m43h.fsf@nightsong.com> <87efiuope8.fsf@nightsong.com> <87lgd1heva.fsf@nightsong.com> <38dfd64c-56be-4ca9-92b8-4688694e38f2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="9aa481526158253a2df1c34e89df6734"; logging-data="1870"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/501rmLMCuGtLYXjF/LRRb" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:ToFxp5M8lLGfLDg0/89fMRoVR7A= sha1:eTB4gsYQTY9oSqVOLEdiZWMtbWI= Xref: reader02.eternal-september.org comp.lang.ada:51932 Date: 2018-05-02T17:25:38-07:00 List-Id: Mehdi Saada <00120260a@gmail.com> writes: > Easy ? Easy ?? Maybe for people who do have learnt Haskell and its > abstruse syntax. I find the Ada version for prime number way easier to > READ. Your example makes me think about Perl. Quick n' > dirty. Especially dirty for future reader. You get used to the syntax. The correctness of the Haskell version is simple to prove by induction. An Ada implementation of that algorithm would be longer to code and maybe messy to prove. Admittedly though, it's not a very good algorithm so picking a different one is ok. The Hamming number example would require considerably more machinery. I'm not even sure how I'd do it in Ada, i.e. maybe with OO.