Proof of concept for v2 - NO duplication, NO `static if` hell, NO difficulty with interoperability

deadalnix deadalnix at gmail.com
Sat Nov 6 01:44:36 UTC 2021


On Friday, 5 November 2021 at 15:06:58 UTC, Paul Backus wrote:
> One idea that's come up recently in the community Discord is a 
> `unique(T)` qualifier, which would guarantee that any memory 
> reachable via indirections in a given `T` value is not aliased. 
> Exactly how to enforce this is an open question.

Here you go: 
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/msr-tr-2012-79.pdf

Unique is a bad name, because it doesn't have to be unique, it 
needs to be a unique entry point to a subgraph of objects, but 
there can be objects within the graph pointing back at the root.

If you go back to my old post about isolated and owned, you can 
find a lot of infos about this.

I'm a bit disappointed though, because I gather from your message 
that the idea is still new for most around here. It solves so 
many of D's problem that it's not even funny, but instead we got 
a numerous features that don't quite work (@nogc, DIP1000, @live, 
...).

I'm glad there is some renewed interest about this. This is such 
an obvious fit for D.


More information about the Digitalmars-d mailing list