On Borrow Checking

Walter Bright newshound2 at digitalmars.com
Sun May 11 18:03:48 UTC 2025


On 5/11/2025 4:32 AM, Timon Gehr wrote:
> Well, it's common enough to need type system support.

That's not necessarily true. You can do everything in C that D does, it's just 
less convenient.


> Support for multiple 
> indirections is also important. Rust actually provides both of these.

There are other ways to do that. Multiple indirections can be handled by using 
structs and then only allowing access to structs through member function interfaces.


>> It's a minor inconvenience that can be refactored away.
> In general you'll have to resort to `@system` code,

While you can always do it with @system code, I'm not convinced some refactoring 
won't work. It's not a disaster to use @system code now and then.


> and it will stand in the way of other refactorings you may want to do.

You've got to do a lot of refactoring to make Rust code work anyway.


> Anyway, I don't think this is a theoretical issue anymore, even though my 
> perspective was the same when we first discussed this. AFAIU, real industry 
> users have already found DIP1000 to be lacking because of its lack of 
> compositionality.

I'm not aware of any particular instance of this, so cannot help with it.


More information about the Digitalmars-d mailing list