D not considered memory safe

claptrap clap at trap.com
Mon Jul 22 19:06:19 UTC 2024


On Friday, 19 July 2024 at 18:19:38 UTC, Walter Bright wrote:
> On 7/13/2024 2:46 PM, Timon Gehr wrote:
>> Well, your suggestion was to put @trusted _everywhere_, not 
>> only on functions with a safe interface. As Dennis points out, 
>> it seems that is exactly what happened in some instances.
>
> That is correct.
>
>> Anyway, `@trusted` indicates that whoever put it there 
>> reviewed the implementation for memory safety. This makes this 
>> approach impractical.
>
> You could call it unwise, or a footgun, or introducing 
> technical debt. But it is practical.
>
> If a surgeon wants to fix a man's heart, first he's going to 
> make things worse by slicing him open like a side of beef.

They use keyhole surgery for a lot of heart ops these days, they 
fit new values by going in through a vein in your leg for example.


> If a mechanic wants to rebuilt an engine, first he has to 
> dismantle a fair chunk of the car, making things worse.

I think you're making a false equivalence.

Your argument for doing it the way you have is that it's the most 
effective way of doing it, not that it's the only way to do it. 
If it were unavoidable there wouldn't even be a debate about it.



More information about the Digitalmars-d mailing list