Memory safe in D

cc cc at nevernet.com
Tue Mar 12 23:42:31 UTC 2024


On Monday, 11 March 2024 at 10:35:55 UTC, Sergey wrote:
> On Monday, 11 March 2024 at 10:21:43 UTC, Alex wrote:
>> No. It was test how D handle uninitialized variables.
>
> Oh right. Didn't get from the first read.
>
> Based on the info from here 
> https://en.wikipedia.org/wiki/Void_safety
> Only TypeScript, C#/F#, Kotlin, Rust, Swift and Dart have this 
> feature.

And Objective-C, in which calling methods on (er, sending 
messages to) null references is not only allowed, it's just good 
manners.  Coming to D from that was a bit of a shock with the 
sudden segfaults, though eventually we adapt.  Still, it would be 
nice to have the option of Errors thrown rather than a straight 
crash.  I assume this is for efficiency reasons, but couldn't a 
compiler flag be a consideration?  Debuggers are nice but it's 
still an extra, external step.



More information about the Digitalmars-d mailing list