DIP 1028---Make @safe the Default---Community Review Round 1

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Jan 7 11:30:23 UTC 2020


On Tuesday, 7 January 2020 at 11:10:03 UTC, JN wrote:
> I actually like how "unsafe" sounds dangerous. It sounds like 
> something to be avoided, and that's how unsafe should be used 
> in a safe-aware code.

Exactly, like walking on a line without a safety rope, biking 
without a helmet, using a chainsaw without protective gear... 
Unsafe = higher probability for failure.

Analogy: I've never cut into my protective gear with a chain saw, 
but I've been close several times... You can work much faster 
with protective gear on as you can focus more on the work and 
keep the saw close (which makes the work more precise).

> You should avoid using it unless needed, and when used it 
> should scream at you "this is dangerous". Kind of like 
> UPPERCASE_DEFINE_MACROS in C.

An interesting point is that a language competing directly with C 
must be an unsafe language. A Turing complete language must emit 
runtime checks in order to finish static analysis in finite time 
(unless you put in fixed limits).



More information about the Digitalmars-d mailing list