On Borrow Checking

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Wed Apr 30 03:25:04 UTC 2025


On 30/04/2025 2:58 PM, Walter Bright wrote:
> On 4/29/2025 6:26 PM, jmh530 wrote:
>> You wrote a blog post on ownership and borrowing back in 2019 
>> (https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/), but 
>> it has just a brief mention of @live. Would you want to expand your 
>> original post with an emphasis on @live, why to use it, and what it 
>> gets you?
>>
>> Otherwise to your point about lack of interest, my recollection is 
>> that there has been a lot of discussion over the years about safe 
>> reference-counting, maybe and allocator-aware container libraries (I 
>> assume this is possible but limited in ways that people aren't happy 
>> about). And my sense is that DIP 1000 and @live haven't quite gotten 
>> us to the place where people want the language to be. That could be a 
>> driver to the lack of interest.
> 
> We spent a considerable time thinking about safe reference-counting. We 
> could not find a way around its considerable performance penalties, and 
> its unsafety, and so abandoned it.

I'm still trying to solve it with my DFA work, however I do have a 
backup plan.

1. Ban all pointers. System handles and with that coroutines/fibers are 
all @trusted and @system so it doesn't effect them. Anything else should 
be using the GC and therefore unaffected by this restriction.

2. Let the backend handle optimizations. Reference counting primitives 
are improving (at least in LLVM). Worst case scenario, we have the exact 
same performance as we do now, but with a better user experience.



More information about the Digitalmars-d mailing list