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,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.germany.com!news.belwue.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Bounds Check Overhead Newsgroups: comp.lang.ada,comp.lang.fortran 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: <0ugu4e.4i7.ln@hunter.axlog.fr> <%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net> <6H9dg.10258$S7.9150@news-server.bigpond.net.au> <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <4475DA61.3080001@comcast.net> <44762F55.4050106@cits1.stanford.edu> <87hd3d1472.fsf@ludovic-brenta.org> <3cBdg.6255$oa3.2407@trnddc08> <87ac9420s5.fsf@ludovic-brenta.org> <2006052614490816807-gsande@worldnetattnet> Date: Sat, 27 May 2006 11:06:21 +0200 Message-ID: NNTP-Posting-Date: 27 May 2006 11:06:21 MEST NNTP-Posting-Host: f168c149.newsread2.arcor-online.net X-Trace: DXC=NPK[70SQ15ERG:gi]CKmZGQ5U85hF6f;DjW\KbG]kaMH[NGU2GAcMGJ6DQ8mU0GR8MWRXZ37ga[7JjTA67ckJ=XE`ekcfE7=N0J X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4528 comp.lang.fortran:10343 Date: 2006-05-27T11:06:21+02:00 List-Id: On Fri, 26 May 2006 17:49:09 GMT, Gordon Sande wrote: > Many search idioms use the fact that a DO index is just another integer > variable which will have a known value on a forced exit from the loop. > It also has a known value when the loop terminates naturally. The index > is the exclusive property of the DO inside the loop but it is visible > to the rest of the program. Being an integer is a new restriction. > > The contract that the programmer has with the compiler is that the > index will not be tampered with. The checking that many systems do is not > exhaustive and proveably correct. It just grumbles about the obvious cases. > If one use F90 well then the compiler will catch many more cases. Too > many folks in a hurry (and who know they never make mistakes) do not > bother (so they spend more time debugging and blaming the hardware or > compiler). Well, maybe Ada and Fortran share some things, but not the design philosophy. Ada standard actually starts with a classification of error: 1. Errors that are required to be detected no later than at compile time 2. Errors that are required to be detected at run-time 3. Bounded errors which detection isn't required, but the effect is bounded 4. Erroneous execution, unbounded effect The design decisions made in Ada are always in favor of 1, maybe at the cost of some idioms. So in Ada modifying the index of a loop isn't a "bounded error" as it seems to be in Fortran, it is a compile-time error. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de