D not considered memory safe

aberba karabutaworld at gmail.com
Sat Jul 6 14:56:27 UTC 2024


On Saturday, 6 July 2024 at 11:07:32 UTC, Sebastian Nibisz wrote:
> On Saturday, 6 July 2024 at 00:21:32 UTC, Walter Bright wrote:
>> On 7/5/2024 12:42 PM, Steven Schveighoffer wrote:
>>> Yes, I'm aware. I purposely did not apply `@safe`. D is not a 
>>> memory safe language, you have to request it.
>>
>> D is memory safe if you type in "safe:" and use the gc.
>>
>> https://dlang.org/spec/memory-safe-d.html
>
> Seriously? Any language is safe in this case, you just need to 
> write safe code.

To say something "doesn't have safety tuned on by default" vs 
"something is unsafe" communicates two different meanings.

 From another angle, would you choose "less freedom but more 
security" or "more freedom but less security"? You can't have 
both.

D is a very safe non-strict modern language. It allows you to 
shoot yourself in the foot or gives you more freedom and control. 
D however does a much better job at preventing you from shooting 
your foot even without strict safety turned on by default.

This argument in my opinion is more about strict vs non-strict 
(by default) because you can have strict safety by default in D 
of you want it.


More information about the Digitalmars-d mailing list