comp.lang.ada
 help / color / mirror / Atom feed
From: Optikos <optikos@verizon.net>
Subject: Re: Microsoft is considering moving to Rust; potential opportunity for Ada2020
Date: Tue, 6 Aug 2019 10:56:05 -0700 (PDT)
Date: 2019-08-06T10:56:05-07:00	[thread overview]
Message-ID: <a4442018-ba84-4fd0-a5c3-8f33f3fc8012@googlegroups.com> (raw)
In-Reply-To: <qicboo$e34$1@dont-email.me>

On Tuesday, August 6, 2019 at 12:01:14 PM UTC-5, Alejandro R. Mosteo wrote:
> On 20/7/19 0:07, Simon Wright wrote:
> > Paul Rubin <no.email@nospam.invalid> writes:
> > 
> >> Optikos writes:
> >>> Yes, I also was wondering why Microsoft isn't fervently exploring
> >>> adding a Rust-esque borrow checker to C#
> >>
> >> C# is garbage collected, I thought.  No need for anything like a
> >> borrow checker.
> > 
> > GC is about safely disposing of memory that's no longer accessible from
> > anywhere in the program.
> > 
> > Borrow checking (AIUI) is about making sure that only one part of the
> > program has write access to a particular piece of memory at once.
> 
> Yes and no. If you check the first chapters in the Rust tutorial, heap 
> memory reclamation is also performed deterministically when the borrow 
> checker determines some memory has no more references left pointing to it.
> 
> I've seen it described as static GC. I guess it's a side-effect of the 
> borrow checker; if you have to know how many mutable/immutable references 
> exist to a block of memory, you end knowing when none are left.

I suspect that each commenter prior to Alejandro Mosteo had their own variant definition of garbage collection.  Some people think garbage collection is limited to mark-&-sweep garbage collection, excluding reference counting.  Other people designate that definition as AGC (automatic garbage collection) and also include reference counting in the generic term garbage collection (without the automatic on the front).  Alejandro is correct:  if a technique can assure that the mutable count is not greater than one, then the technique has enough wherewithal to know when the mutable + immutable count goes less than 1 (i.e., zero) to release the resource via reference counting.  Although, how does Rust's borrow checker assure the lack of cycles (or assure that the cyclic references are self-contained in a glob that itself has an acyclic reference count, so that the entire glob is condemned en masse)?  How much of a borrow-checker-esque approach is going to appear in Ada202X, especially now that the timeline is extended?

The book _Garbage collection:  Algorithms for automatic dynamic memory management_ presents both of these variant definitions (and more shade-of-meaning flavors too).

https://www.worldcat.org/title/garbage-collection-algorithms-for-automatic-dynamic-memory-management/oclc/301048851

> That's my superficial understanding (haven't done any serious Rust). I'm 
> frankly impressed by the concept. It seems to be a real contribution to 
> the general landscape. Too bad the syntax gets ugly pretty quickly; I 
> wonder about long-term maintainability.
> 
> Also, the particular interest of Microsoft in Rust is clear to me; it 
> precludes whole classes of memory errors that make for a big chunk of 
> security vulnerabilities.

  parent reply	other threads:[~2019-08-06 17:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 18:17 Microsoft is considering moving to Rust; potential opportunity for Ada2020 Optikos
2019-07-17 18:53 ` Maciej Sobczak
2019-07-17 22:59   ` Optikos
2019-07-17 23:35     ` Paul Rubin
2019-07-18  0:29       ` Optikos
2019-07-19 22:07       ` Simon Wright
2019-07-19 22:12         ` Paul Rubin
2019-08-06 17:01         ` Alejandro R. Mosteo
2019-08-06 17:49           ` Brad Moore
2019-08-07  9:09             ` Alejandro R. Mosteo
2019-08-08  2:13               ` Jere
2019-08-08  9:25                 ` Alejandro R. Mosteo
2019-08-06 17:56           ` Optikos [this message]
2019-08-06 20:04             ` Brad Moore
2019-08-07  9:07             ` Alejandro R. Mosteo
2019-07-25 18:40 ` G. B.
2019-07-26 14:12   ` Shark8
2019-08-15 15:39     ` Norman Worth
2019-10-01  8:04       ` Mehdi Saada
2019-10-02 17:11         ` Shark8
2019-07-26 14:11 ` Shark8
2019-07-27 20:03   ` Optikos
2019-07-27 20:17     ` Optikos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox