-preview switches

Steven Schveighoffer schveiguy at gmail.com
Wed Apr 1 14:15:36 UTC 2020


dmd '-preview=?'

Upcoming language changes listed by -preview=name:
   =all              list information on all upcoming language changes
   =dip25            implement 
https://github.com/dlang/DIPs/blob/master/DIPs/archive/DIP25.md (Sealed 
references)
   =dip1000          implement 
https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1000.md (Scoped 
Pointers)
   =dip1008          implement 
https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1008.md (@nogc 
Throwable)
   =dip1021          implement 
https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1021.md 
(Mutable function arguments)
   =fieldwise        use fieldwise comparisons for struct equality
   =markdown         enable Markdown replacements in Ddoc
   =fixAliasThis     when a symbol is resolved, check alias this scope 
before going to upper scopes
   =intpromote       fix integral promotions for unary + - ~ operators
   =dtorfields       destruct fields of partially constructed objects
   =rvaluerefparam   enable rvalue arguments to ref parameters
   =nosharedaccess   disable access to shared memory objects


Any idea on when these will become permanent or be removed? We are 
collecting quite a few of these. Which means, we are currently shipping 
2^11 different compilers simultaneously (I know there's really less 
since some of them activate the others).

If nobody knows about these switches, then they don't get used, you 
can't build libraries with them (including phobos/druntime), and you 
won't use them. Which means existing code is not going to be prepared 
when we turn these on.

Alternatively, we should examine other ways to progress these changes 
(or cancel them). I think the only preview switches I've ever used are 
dip1000 and dip25. I forgot about all the others.

One I can see right now that is probably not controversial is the 
markdown one.

This is another reason to have a distinctive versioning system, we could 
target specific versions for permanent inclusion of these switch 
features, and people can work on making sure things work with those 
switches. By just tossing switches out there and forgetting about them, 
they don't get the attention they need.

-Steve


More information about the Digitalmars-d mailing list