Tell us your DIP1000 woes

Elias Batek desisma at heidel.beer
Mon Aug 26 00:53:05 UTC 2024


On Sunday, 25 August 2024 at 13:10:22 UTC, Mike Parker wrote:
> If you've had problems using DIP1000, please post here with a 
> description of what you encountered and any details about it 
> you think we may find helpful.

One of the most common issues I run into when talking about 
DIP1000 is that DIP1000 is actually two things:

1. Plugging holes in `@safe`.
2. Providing a mechanism the return/ref/scope mechanism 
re-enables most of the sort of code that is flagged `@system` 
after implementing the former.

Furthermore, I have yet to meet anyone who tells me that adding 
2-word attributes (`scope return` vs `return scope`) to the soup 
was a great choice. I see a major comprehensibility problem with 
these.

It’s also a bit funny that all of those things are still referred 
to as “DIP1000”. If one takes just a slight glimpse at the 
document of the same name, it clearly says “Superseded”.

I do understand why the article “Coralling Wild Pointers With ref 
return scope” explains most of the concepts on raw pointers. But 
on the other hand I’m not sure how useful those are to the 
unsuspecting users who run into DIP1000 violations with static 
arrays or refs.

Or they even just wanted to use `std.getopt` in `@safe` code and 
ended up dealing with DIP1000. That’s what made me turn on the 
compiler switch for first time.


More information about the Digitalmars-d mailing list