Would the ownership model make D lang as complicated as Rust?

Timon Gehr timon.gehr at gmx.ch
Mon Nov 16 22:16:13 UTC 2020


On 16.11.20 21:17, M.M. wrote:
> On Sunday, 15 November 2020 at 14:34:24 UTC, Timon Gehr wrote:
>> On 15.11.20 15:11, donallen wrote:
>>>
>>> I don't know exactly how Walter intends to proceed with adding 
>>> Rust-like move semantics to D, but the little I know suggests that it 
>>> will be optional. If I'm right, that's very wise. Move semantics and 
>>> no GC for those who really need it (justifying its cost) and the 
>>> luxury of the GC for those who don't.
>>
>> And an unsound interface between the two so you can have your O/B and 
>> safety type checks and even get the luxury of some memory corruption 
>> anyway.
> 
> Are you sceptical of introducing O/B principles into current D, or is it 
> just about how it's being discussed/implemented?

I'm all for it, it's just that the specific approach that has been put 
forward does not work (in addition to being less expressive than what 
Rust has). I have suggested alternatives, but no discussion arose from it.

Basically, you can't get useful O/B features that ensure memory safety 
using a function annotation, you'd need borrowed references and some 
library features. @live is a function annotation because it is easier to 
implement; it's not a sound thing to do. At the same time the messaging 
around @live has been contradictory, Walter on the one side essentially 
stated that it was just him messing around with new type checker 
features that may even turn out to be useful as linting hints to someone 
writing some @system code and on the other side it was already being 
advertised as bringing Rust-like safety features to D. However, as far 
as I can tell, there is still no coherent design that would allow for 
that. (Looking forward to Walter's keynote though.)


More information about the Digitalmars-d mailing list