Type state analysis

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sat Mar 30 02:41:24 UTC 2024


On 30/03/2024 3:30 PM, Walter Bright wrote:
> Isn't it a big ask to get people to add all those annotations?

If people had to write annotations yes.

The key will be making sure that they don't have to, the defaults should 
be good enough, or at bare minimum match what we assume today.

What I am unsure about currently is related to pointers (that are not 
the this pointer).

Should we require them to be nonnull by default and allow people to opt 
out like in other languages, or do we go in the inverse and go with what 
we have now and stick to initialized and must be opt-in to the stronger 
type state of nonnull.

Slices are quite often null on purpose, what about them?

What about consistency between @safe and @system?

There are some unanswered questions that may be better answered after 
experience with it. Although I'm in favor of doing things differently 
than other languages and make people think about their assumptions for 
their code, rather than assume stronger guarantees that may not have 
been considered.


More information about the dip.ideas mailing list