digitalmars.D - safe by default and old code
- Kirill (6/6) Aug 05 2021 I've heard that there are plans to make D `@safe by default`.
- Dylan Graham (10/16) Aug 05 2021 The question pops up every few months, but I don't think anything
- Paul Backus (8/9) Aug 05 2021 The plan to make `@safe` the default was [DIP 1028][1].
- Kirill (2/11) Aug 05 2021 Thank you for the update.
- Patrick Schluter (4/10) Aug 05 2021 Even if it is implemented one day, there will be a command line
I've heard that there are plans to make D ` safe by default`. Then the question that pops into my head is what will happen to all the code that was written before it and once it is implemented? Will it require a rewrite? How should the code be written from now on to avoid this?
Aug 05 2021
On Friday, 6 August 2021 at 00:30:36 UTC, Kirill wrote:I've heard that there are plans to make D ` safe by default`.The question pops up every few months, but I don't think anything has been decided.Then the question that pops into my head is what will happen to all the code that was written before it and once it is implemented? Will it require a rewrite?I assume that there will be a deprecation phase before that is implemented so that codebases and dependencies have ample time to adjust to upcoming changes, without breaking them in the meanwhileHow should the code be written from now on to avoid this?Declaring ` safe:` at the top of your module sort of does the same thing. Try to use safe D where ever you can, and mark other things as ` trusted` and ` system` as appropriate. more experienced D users, feel free to correct me.
Aug 05 2021
On Friday, 6 August 2021 at 00:30:36 UTC, Kirill wrote:I've heard that there are plans to make D ` safe by default`.The plan to make ` safe` the default was [DIP 1028][1]. Ultimately, it was rejected due to lack of consensus regarding how `extern(C)` functions should be handled. Since then, no new plan has been made, and it is probably safe to assume that ` system` will remain the default. [1]: https://github.com/dlang/DIPs/blob/master/DIPs/rejected/DIP1028.md
Aug 05 2021
On Friday, 6 August 2021 at 03:47:03 UTC, Paul Backus wrote:On Friday, 6 August 2021 at 00:30:36 UTC, Kirill wrote:Thank you for the update.I've heard that there are plans to make D ` safe by default`.The plan to make ` safe` the default was [DIP 1028][1]. Ultimately, it was rejected due to lack of consensus regarding how `extern(C)` functions should be handled. Since then, no new plan has been made, and it is probably safe to assume that ` system` will remain the default. [1]: https://github.com/dlang/DIPs/blob/master/DIPs/rejected/DIP1028.md
Aug 05 2021
On Friday, 6 August 2021 at 00:30:36 UTC, Kirill wrote:I've heard that there are plans to make D ` safe by default`. Then the question that pops into my head is what will happen to all the code that was written before it and once it is implemented? Will it require a rewrite? How should the code be written from now on to avoid this?Even if it is implemented one day, there will be a command line option in the compiler to disable it exactly for the reason you brought up.
Aug 05 2021