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!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: a new language, designed for safety ! Date: Tue, 17 Jun 2014 14:18:10 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1402308235.2520.153.camel@pascal.home.net> <85ioo9yukk.fsf@stephe-leake.org> <9qednXOIGNDuLQXORVn_vwA@giganews.com> <1872904482424209024.314619laguest-archeia.com@nntp.aioe.org> <810507a4-427e-42bb-a468-e5939a4470db@googlegroups.com> <9qbfr6yf0gnb.182y1qs9eigz4$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1403032690 13705 69.95.181.76 (17 Jun 2014 19:18:10 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 17 Jun 2014 19:18:10 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:20404 Date: 2014-06-17T14:18:10-05:00 List-Id: "Robert A Duff" wrote in message news:wccoaxss9po.fsf@shell01.TheWorld.com... ... > For yet another example, it lacks the "tampering" business required by > the RM. I didn't need all sorts of Cursors pointing into the middle of > Vectors, so I didn't need those run-time checks. Reminder: Those run-time checks have two purposes: (1) to prevent iteration from going off into the weeds if the container is modified during iteration. Perhaps you only support iteration by indexes such that that isn't a problem. (2) to prevent elements from disappearing or causing erroneous execution while they are in use. There's nothing about "cursors pointing into the middle of vectors". Indexing is only "safe" if some sort of element check is performed; in many cases the check isn't needed (if the element is used quickly and then discarded), but passing an element (or part of an element) as a parameter is common and there lie dragons. The reason that using indexing in the standard containers is slow is because it requires compiler support to eliminate the check in the cases where it is not needed (probably over 90% of the cases in practice). But most implementors just write an Ada package and let the chips fall where they may. That won't give decent performance. Other languages just let all container use be erroneous if one makes a mistake. We didn't want containers to be significantly less safe than an array (which doesn't have these issues as an element cannot be removed). Maybe that was a mistake, as safety no longer seems to matter. Randy.