On Borrow Checking
Walter Bright
newshound2 at digitalmars.com
Mon May 12 19:00:19 UTC 2025
On 5/12/2025 5:34 AM, Timon Gehr wrote:
> Even in `@system` code you cannot assign an `int` to an `int*`, you have to use
> an explicit cast. I don't think it is true that just because `@system` does not
> give you memory safety guarantees it will therefore be expected that features do
> not work at all.
@system code is intended to be rare in a properly written D program.
Unfortunately, D code is not @safe by default. We are moving to @safe by
default, but that requires the editions feature.
Where the line is drawn for what is allowed in @system code is a judgement call,
not an obvious thing. Requiring `scope` to be transitive across existing default
code would discourage people from using it.
Again, I'll point out all the complaints about @nogc being transitive and
thereby making it difficult to use in existing code.
More information about the Digitalmars-d
mailing list