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: border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!border2.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: a new language, designed for safety ! Date: Mon, 16 Jun 2014 19:42:11 -0400 Organization: The World Public Access UNIX, Brookline, MA 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: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1402962113 21684 192.74.137.71 (16 Jun 2014 23:41:53 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 16 Jun 2014 23:41:53 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:gSJmVnED9nxNAPOjZe7aGadbL7I= X-Original-Bytes: 3084 Xref: number.nntp.dca.giganews.com comp.lang.ada:186990 Date: 2014-06-16T19:42:11-04:00 List-Id: Jeffrey Carter writes: > On 06/16/2014 02:53 PM, Robert A Duff wrote: >> >> It's also unfortunate that Vectors are inherently slow. To be clear: I meant that Ada.Containers.Vectors as defined by the Ada RM are inherently slow. Not that all possible vector-like (i.e. growable-array implementations) are inherently slow. >>...I wrote a big >> program recently that made heavy use of Vectors. The Ada 2012 features >> were essential for readability -- Vectors would have been unusable >> otherwise. But Vectors was way too slow. So I wrote my own vectors >> package, using the same 2012 features, and then it was fine -- both >> readability-wise and efficiency-wise. > > If Vectors are inherently slow, how were you able to write one that wasn't? By writing one that has different semantics -- i.e. does not obey all the Ada RM rules for Ada.Containers.Vectors. For example, it has the operations I happened to need (like Append), but lacks the ones I did not (like Insert). For example, it supports easy and efficient conversions Vector <--> array. 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. The new Ada 2012 features made my vectors usable from a readability point of view, just as they have for Ada.Containers.Vectors. - Bob