Prototype of Ownership/Borrowing System for D
Timon Gehr
timon.gehr at gmx.ch
Sun Nov 24 14:28:39 UTC 2019
On 24.11.19 03:10, mipri wrote:
> On Saturday, 23 November 2019 at 23:40:05 UTC, Timon Gehr wrote:
>> ...
>> but if they
>> will, it will inevitably infect libraries and suddenly, yes, I
>> will have to deal with it.
>
> How will you have to deal with it? Code can't require that
> their callers have @live.
It will inevitably _assume_ that its @safe callers have @live (otherwise
it wouldn't have chosen to bother with @live @safe). So sure, you can
violate that assumption, but then you risk memory corruption in
so-called @safe functions. It's memory safety by convention.
> It's your preferred alternative that
> would necessarily entangle users of libraries.
>
No, it's a take it or leave it situation. It would enable @safe
implementations of functions that can't have @safe implementation at all
right now. I'm not taking away anyone's option to write @system code.
As I said, if the goal of @live is just to provide some linting in
@system code, that's fine, but the stated goals are actually more ambitious.
More information about the Digitalmars-d
mailing list