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!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Microsoft is considering moving to Rust; potential opportunity for Ada2020 Date: Tue, 6 Aug 2019 19:01:12 +0200 Organization: A noiseless patient Spider Message-ID: References: <01e1fc91-a20e-4b48-a10e-57d3935cd06c@googlegroups.com> <0d4e46d4-c227-4d7a-aafa-44492c6e1d41@googlegroups.com> <871ryop74h.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 6 Aug 2019 17:01:12 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="8da68dfb665bf1cdffef8e288db1e5a5"; logging-data="14436"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fHsvFBLn5WTGcAACapy+X" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cancel-Lock: sha1:xvBSYWv9k/21kRJ5e1dAh6SOc34= In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:56997 Date: 2019-08-06T19:01:12+02:00 List-Id: On 20/7/19 0:07, Simon Wright wrote: > Paul Rubin 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. 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.