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 X-Received: by 2002:ac8:28b:: with SMTP id p11-v6mr10820588qtg.52.1525199435555; Tue, 01 May 2018 11:30:35 -0700 (PDT) X-Received: by 2002:a1f:b09:: with SMTP id 9-v6mr2535334vkl.13.1525199435416; Tue, 01 May 2018 11:30:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.swapon.de!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!x25-v6no9323959qto.0!news-out.google.com!p41-v6ni904qtp.1!nntp.google.com!x25-v6no9323952qto.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 1 May 2018 11:30:35 -0700 (PDT) In-Reply-To: <87po2fl1pm.fsf@nightsong.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.233.194; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.233.194 References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87k1su7nag.fsf@nightsong.com> <87po2la2qt.fsf@nightsong.com> <87in8buttb.fsf@jacob-sparre.dk> <87wowqpowu.fsf@nightsong.com> <16406268-83df-4564-8855-9bd0fe9caac0@googlegroups.com> <87o9i2pkcr.fsf@nightsong.com> <87bme2oy91.fsf@nightsong.com> <877eoom26h.fsf@nightsong.com> <87y3h3lpel.fsf@nightsong.com> <87po2fl1pm.fsf@nightsong.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3bde50df-4b23-4c7f-a1e8-db51d283e1aa@googlegroups.com> Subject: Re: How to get Ada to ?cross the chasm?? From: "Dan'l Miller" Injection-Date: Tue, 01 May 2018 18:30:35 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:51892 Date: 2018-05-01T11:30:35-07:00 List-Id: On Tuesday, May 1, 2018 at 12:34:14 PM UTC-5, Paul Rubin wrote: > "Jeffrey R. Carter" writes: > > None that I have any familiarity with (admittedly a limited subset) > > do. They have lists, and operations that let you use lists with an > > array-like syntax, but no arrays. >=20 > Can you name *one* FP language that doesn't have arrays? One in actual > use, not an obscure toy language or research testbed. I am pretty sure that Jeffrey Carter's school of thought would be focusing = on how =E2=80=A2mutability=E2=80=A2 of arrays is handled as =E2=80=A2not=E2= =80=A2-in-situ assignments to a memory location at an offset from a base ad= dress. To wit, here is the rub in Haskell documentation: =E2=80=9C=E2=80=A6 In the incremental case, we have a function that produce= s an empty array of a given size and another that takes an array, an index,= and a value, producing a new array that differs from the old one only at t= he given index. Obviously, a naive implementation of such an array semantic= s would be intolerably inefficient, either requiring a new copy of an array= for each incremental redefinition, or taking linear time for array lookup;= thus, serious attempts at using this approach employ sophisticated static = analysis and clever run-time devices to avoid excessive copying. =E2=80=A6= =E2=80=9D I am pretty sure that Jeffrey Carter's school of thought would be focusing = on the =E2=80=9Cclever run-time devices to avoid excessive copying=E2=80=9D= there in cases where the design or problem-space precludes monolithic arra= ys created with wholesale-known values at each element en masse. I am pret= ty sure that his school of thought would be pointing out that Haskell's =E2= =80=9Cclever run-time devices to avoid excessive copying=E2=80=9D in essenc= e produces a =E2=80=A2list=E2=80=A2* of deltas to the array in the incremen= tal case (which are then scooped up en masse when creating a monolithic arr= ay initialization from those incrementally written array-elements). * or considering this array as hash table, where the incremental updates to= certain elements are de facto hash-table =E2=80=98collisions=E2=80=99, whi= ch are typically represented by an array of potential/initially-empty linke= d lists https://www.haskell.org/tutorial/arrays.html Btw, Pat, in the 1000-page encyclopedia of commonplace Ada recipes (and lam= basting other languages) this would be: 15) here are incremental writes to an array in Haskell, but here is Ada's b= etter way for in-situ writes to arbitrary elements within an array, along w= ith space & time performance analysis, comparing Haskell to Ada.