Discussion Thread: DIP 1028--Make @safe the Default--Final Review

Steven Schveighoffer schveiguy at gmail.com
Wed Mar 25 18:04:33 UTC 2020


On 3/25/20 1:34 PM, bachmeier wrote:
> On Wednesday, 25 March 2020 at 14:10:18 UTC, Steven Schveighoffer wrote:
> 
>> Everything else in the DIP is possibly annoying to deal with but at 
>> least doesn't silently destroy the meaning of @safe.
> 
> To be perfectly honest, I can't imagine D being a sensible option for 
> someone wanting to work heavily with C code if you have to add pointless 
> annotations and constantly deal with compiler errors. It's not a matter 
> of annoyance, it's simply impractical to add that kind of overhead, 
> particularly if someone else is involved. If you're using C, you're well 
> aware that it's not going to be safe. Rust was designed for *writing* 
> safe code, not for wrapping C libraries, which is maybe the main use of 
> D right now.

This is overblown. Adding @system: at the top of a c library header is 
not hard.

Tools which generate headers for C libraries (e.g. dpp) can 
automatically do the right thing.

-Steve


More information about the Digitalmars-d mailing list