Memory safe in D
Alex
akornilov.82 at mail.ru
Tue Mar 12 19:33:17 UTC 2024
On Tuesday, 12 March 2024 at 17:47:32 UTC, Walter Bright wrote:
> Yeah, I know about that article. It's very popular. I've
> written a sort of rebuttal:
>
> https://www.digitalmars.com/articles/C-biggest-mistake.html
If you ask me about root of evil in C I will answer it is
pointers with their arithmetic.
If you ask me about root of evil in Java I will answer it is null
"pointer" (reference actually) :)
> With Java, it is also not a memory safety issue when there's a
> null exception.
I think it depends on what we means "memory safety". If only
"dangling pointers", I agree. But if we want to have strict
guarantee at compilation time that any accessible reference leads
to alive object answer is no, SafeD can't provide such guarantee
yet.
> It is always better to catch null mistakes at compile time
> rather than runtime, but it isn't a memory safety issue.
Are D foundation considering the possibility to implement
something like this in future version of D?
More information about the Digitalmars-d
mailing list