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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e7ceb00d83425e3a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 17 May 2008 11:45:51 +0200 From: Georg Bauhaus Reply-To: rm.tsho+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.14 (X11/20080502) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: rant (Re: Ada featured in Doctor Dobb's Journal ) References: <31a97103-1cbb-47b5-a93c-2a29c206556f@e39g2000hsf.googlegroups.com> <0d254195-50cb-4bad-b776-8d5c2ab09b6c@m45g2000hsb.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <482ea950$0$6774$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 17 May 2008 11:45:53 CEST NNTP-Posting-Host: d92dc9fa.newsspool2.arcor-online.net X-Trace: DXC==lV^9Gf4_]MWDmlTRbh@=IA9EHlD;3YcB4Fo<]lROoRA8kFejVH61:]o7ROBkKQ7TO7Ca]WFH X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:151 Date: 2008-05-17T11:45:53+02:00 List-Id: jhc0033@gmail.com wrote: > But this guy uses Ada, because as we saw before, using > different languages is OK, and the safety community uses it. He solved > some discrete math problem he was trying to solve. I think you've missed a piece that other newcomers to Ada have reported, too, has helped them: That the language almost automatically makes you think about how to model objects as types even at the lowest possible level, i.e. at the bits level; where you would be used to "machine types" like int, float, double etc. you start using abstraction, i.e. named numeric types, etc, without run-time overhead, but with static type checks. Plus, you can build other types around different named numeric types and get statically type checked operations at a low level, e.g. procedure News13 is -- 4-space: type Enough_Precision is digits 11; -- fpt for my algorithm type Index_Type is range 0 .. 3; -- need 4-tuples type T4 is array(Index_Type) of Enough_Precision; pragma Convention(Fortran, T4); -- can pass to Fortran type Count_Type is range 0 .. 1_000; -- num of measurements type Fruit is (Banana, Apple, Pear); point_in_space: T4; c: Count_Type; begin c := 4; point_in_space(c) := 1.0; -- won't compile, c not in Index_Type point_in_space(4) := 1.0; -- index constraint violation diagnosed point_in_space(Banana) := 1.0; -- error, Banana ∉ Index_Type end News13; > He could have > solved it just as easily in any other language perhaps, but would we > write an article about it? The end". Perhaps, but then he says that his solution has been easier than what he did before because he could do low level programming yet write "wheels" abstractions.