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: a07f3367d7,4215feeab2a8154a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.mind.de!bolzen.all.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: C++0x and Threads - a poor relation to Ada's tasking model? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <7q2385104kihs87d79p8kfphuoki6r01vq@4ax.com> <7961a91c-a5af-40e2-bbc0-6bf69a98176d@z31g2000yqd.googlegroups.com> <362f621e-a01c-4772-ba02-4e18e9962188@j19g2000vbp.googlegroups.com> <128d63da-361f-4e33-be5e-e06bdc71e39f@r34g2000vba.googlegroups.com> <6d23274b-d649-4a83-a6f1-6d1e9c4c3998@d34g2000vbm.googlegroups.com> <4A83D107.2020407@obry.net> <196q25f7ntf6a$.tj10ulon3mmt.dlg@40tude.net> <4A83F9C2.3000700@obry.net> Date: Thu, 13 Aug 2009 14:28:43 +0200 Message-ID: <1376nmezwawim.1mqgiaglsrvwe.dlg@40tude.net> NNTP-Posting-Date: 13 Aug 2009 14:28:43 CEST NNTP-Posting-Host: 4967dfce.newsspool3.arcor-online.net X-Trace: DXC=@]eBDW1EgEc]BlmkiiU@BiMcF=Q^Z^V3h4Fo<]lROoRa^YC2XCjHcbi6GJc@X3K_\nDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgbMA8k@^k]7aj X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7728 Date: 2009-08-13T14:28:43+02:00 List-Id: On Thu, 13 Aug 2009 13:32:18 +0200, Pascal Obry wrote: >> Don't you wonder why should it be this way? Shouldn't safer code be more >> efficient? > > Should... maybe! My experiences is often that Ada is a *bit* slower. I > have also some experiences where a concurrent and distributed > application in Ada was a bit faster than a C++ one using OpenMP + MPI. In that case there must be something suboptimal in the language design. I would also argue that where C++ is faster, the corresponding C++ code is probably wrong, which a full coverage test would show. The trick is, that nobody tests the code. >> properly defined allows a deeper optimization and safer programming. > > Well checks are still taking some time. Note that I was speaking of > applications built with checks on. To continue the argument above: 1. These checks must be there, else the program is wrong 2. The language is wrong not allowing programmer to design these checks static [*] When it is neither 1 nor 2, then it is something which we can prove to be OK in our program, while the compiler cannot. Is a normal programmer that smart? ----------- * Example in Ada. If you wanted to iterate two arrays at once, you could not eliminate index checks of one of them: for I in A'Range loop ... A (I) + B (I + B'First - A'First) ... -- No way to eliminate B index check end loop; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de