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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a05:660c:2c6:: with SMTP id j6mr1963082itd.9.1553044134878; Tue, 19 Mar 2019 18:08:54 -0700 (PDT) X-Received: by 2002:a9d:704c:: with SMTP id x12mr4049488otj.28.1553044134301; Tue, 19 Mar 2019 18:08:54 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!w126no31025ita.0!news-out.google.com!l81ni71itl.0!nntp.google.com!78no31423itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 19 Mar 2019 18:08:53 -0700 (PDT) In-Reply-To: <87zhpq33h1.fsf@nightsong.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 References: <6e1977a5-701e-4b4f-a937-a1b89d9127f0@googlegroups.com> <6f9ea847-2903-48c8-9afc-930201f2765a@googlegroups.com> <87zhpq33h1.fsf@nightsong.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5dbd0a83-2d28-4c39-a973-2f0365d93846@googlegroups.com> Subject: Re: Intervention needed? From: Jere Injection-Date: Wed, 20 Mar 2019 01:08:54 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55908 Date: 2019-03-19T18:08:53-07:00 List-Id: On Tuesday, March 19, 2019 at 6:26:51 PM UTC-4, Paul Rubin wrote: > "Randy Brukardt" writes: > > Rust... You can't build a cursor that way (nor a doubly-linked > > list). Perhaps the Rust people have gone beyond simple borrow > > semantics -- I don't know. > > I did a little web searching and it does seem to me that as of a year or > so ago, the way to make doubly linked lists in Rust was to call some > kind of unchecked library. I'd like to know how it's done in ATS, and > I might ask on a Rust chat if it's still like that in Rust. > > I think it might be a serious issue for Rust, since one of Rust's > driving applications was web browsers. Those build DOM trees where > nodes point to both their children and their parent, so the tree is full > of cycles. If you need either doubly linked lists or maps in Rust, you use the ones provided by the standard library (std::collections::list, for example, is the doubly linked list). It's not unchecked at all. If you want to roll your own doubly linked list, then you will need to have to have a couple of "unsafe" calls (they don't really have libraries that are unchecked, mostly just traits and operations). They are small conversions usually. It is similar to trying to implement the standard containers in Ada where you may have to do unchecked_deallocations, unchecked_conversions, compiler specific operations/attributes, etc. to implement things like tampering checks and memory deallocation. In both Rust and Ada you can restrict them to small localized sections. The big difference really ends up being the ecosystems. The Rust community tends to lobotomize libraries with unnecessary unsafe calls where the Ada community doesn't really have a centralized library system that facilitate that. Not that it couldn't. reference for the doubly linked list in standard rust (no unsafe calls): https://doc.rust-lang.org/std/collections/struct.LinkedList.html