News for hackers. Stuff that matters.
Re:D’s Newfangled Name Mangling by 52-6F-62 on Wednesday December 20, 2017 @04:16PM (#15973901)
It would be a little more accurate to say that in D, memory safety is optional.

If you wrote every method using the @safe flag, you'd be forced to write a memory-safe program. Eg:

    void main() @safe
    {
      int everything = 42;
      int* theAnswer = &a;
      int* earth     = theAnswer * 2; // Won't compile. 
    }
With no flag or @system, safety is not ensured. Using @trusted will allow a function to be called, safe or not, from other safe functions ending the safety. But by design @safe functions can only call other @safe functions.

There are no comments on this comment yet.