|
|
|
|
|
by stepik777
3101 days ago
|
|
Maybe it is just not a good technology. Just compare it to others: C++ - memory unsafe, no GC. Java - memory safe (by default), has GC. Rust - memory safe (by default), no GC. D - memory unsafe (by default), has GC. Authors of Java solved memory safety by adding garbage collector. Authors of Rust managed to make memory safe language without GC while authors of D made a language with GC that is still memory unsafe. |
|
If you wrote every method using the @safe flag, you'd be forced to write a memory-safe program. Eg:
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.