Prototype of Ownership/Borrowing System for D

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Nov 25 20:39:48 UTC 2019


On Monday, 25 November 2019 at 20:32:03 UTC, Doc Andrew wrote:
> On Monday, 25 November 2019 at 00:10:41 UTC, Ola Fosheim 
> Grøstad wrote:
>> Looks more like it is defining what authors should not do in 
>> unsafe code for Rust to make optimizations under the 
>> assumption that unsafe code is wellbehaved. Then they provide 
>> an interpreter that dynamically borrow checks tests by running 
>> the code... In order to capture situations that rust cannot 
>> deal with statically. Or something to that effect.
>>
>> TLDR; they specify undefined behaviour in order to enable 
>> optimization.
>>
>
> Yeah, that's about as much as I was able to take from it 
> yesterday. I wasn't sure if the stacked borrow technique might 
> be useful for catching some of the errors that Timon pointed 
> out with the interface between @live and @system code. I think 
> most of us would consider the UB an error, rather than an issue 
> with optimization?

Well, my take speedreading the paper was that they try to arrive 
at a "memory model" for Rust that enables aliasing optimizations 
while not limiting unsafe code too much. So they try out 
different models by building the model into the interpreter and 
run it on many programs to see how limiting their new rules are.

Anyway, one of the authors has blogged about what he was 
interested in exploring here:
https://www.ralfj.de/blog/2019/05/21/stacked-borrows-2.1.html



More information about the Digitalmars-d mailing list