Why is three safety levels need in D?

Stefan Koch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Nov 17 09:49:23 PST 2016


On Thursday, 17 November 2016 at 17:47:21 UTC, Nordlöw wrote:
> On Thursday, 17 November 2016 at 17:33:33 UTC, Stefan Koch 
> wrote:
>> Memory is inherently unsafe. But it can be treated in a safe 
>> way.
>> A language that does not allow you to express a middle ground 
>> will have a lot of unsafe code that could arguably be seen as 
>> safe.
>
> So in what way would, for instance, a Rust-implementation of 
> D's `Mallocator` be different and more unsafe without 
> `@trusted`?

It would be unsafe and all code that uses it would be unsafe as 
well.



More information about the Digitalmars-d-learn mailing list