DIP1000 observation

Dukc ajieskola at gmail.com
Mon Aug 26 15:42:28 UTC 2024


Bruce Carneal kirjoitti 25.8.2024 klo 20.55:
> The lesson I take from the DIP 1000 history is that we need something 
> that is simpler to explain, something that is much easier to use 
> correctly, something that models the problem more clearly.

You mean Robert's Simple Safe D. The thing is, Simple Safe D will/would 
break just as much existing code, because it's the same things - static 
array slicing and addresses of struct/class fields - that you need to 
change.

The question is, what are we really annoyed about with DIP1000? If it's 
because we have too many hotshots who overuse DIP1000 attributes and 
then expect others to understand it, Simple Safe D would indeed put stop 
to that. But if it's simply dealing with breakage (my impression), it's 
going to be the same either way, so better to just improve the 
experience of dealing with it.

That probably means reining in the `scope` autoinference a bit and make 
the DIP1000 error message to suggest the GC-using alternatives. As an 
oversimplification, imagine DMD that understands `scope` / `return 
scope` when you write them, but always suggests Simple Safe D 
workarounds when you forget to apply the attributes.


More information about the Digitalmars-d mailing list