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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 23 Mar 2005 17:17:59 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1111607633.301232.62490@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1111616279 8429 192.74.137.71 (23 Mar 2005 22:17:59 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 23 Mar 2005 22:17:59 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:9849 comp.lang.c++:46938 comp.realtime:1645 comp.software-eng:5249 Date: 2005-03-23T17:17:59-05:00 List-Id: "Jerry Coffin" writes: >...effort that's put into > compile-time checks more or less directly translates into time and > effort that was NOT put into better code generation and optimization. True, but I think you misunderstood Peter Amey's point. I believe he's not talking about run-time checks that can be optimized away with some compiler effort, but about purely compile time rules. For example, both languages have visibility rules, but I find Ada's visibility rules to be less error prone than those of C++. > Maybe...or maybe not. IME, absolute statements about generalities (e.g. > all implementations of a language) are rarely accurate. Ada compilers > vary quite widely, and I've certainly seen some emit code that included > checks that were logically unnecessary. I'd guess that the current > compilers are better, but perfection in this respect would surprise me. It would surprise me, too, since it's provably impossible! This is what Appel calls the full employment act for compiler writers: no matter how smart a compiler is at optimizing, you can always make it smarter. And that's formally provable. The real question is to what extent can checks be optimized away, and how often one needs to resort to suppressing them, and this question can only be answered via measurement. By "measurement" I don't mean bogus benchmarks written to make a point on one side or the other. ;-) By the way, *most* of the work a compiler does to optimize away checks is the same as for other optimizations (despite what some Ada fans have claimed in this thread), so optimizing away checks is not as costly as you seem to think (in terms of compiler-writer's effort). > Some areas are somewhat more questionable -- calling a class a "tagged > record" is clearly a mistake, ... Sorry, but if you think a class is called a tagged record in Ada, you don't understand the language. >... but it's open to question whether it > should be classified under poor expression of the concept, or just > general idiocy. ;-) - Bob