News for hackers. Stuff that matters.
Re:Hecto: Build your own text editor in Rust by mhh__ on Monday January 18, 2021 @11:42PM (#25830072)
> No memory safety in D though.

Not true. Even ignoring the GC we have compiler checked semantics for an increasingly large subset of features, and the language has had ways of managing code that is safe, unsafe, or trusted for years and years now.

As a newly minted employee of the D foundation, I am aiming to work to expand the memory safety features D has.

Re:Hecto: Build your own text editor in Rust by nicoburns on Tuesday January 19, 2021 @12:14AM (#25830237)
Is there a way to make it safe-by-default, such that I can't accidentally stray beyond what the compiler can prove safe?
Re:Hecto: Build your own text editor in Rust by mhh__ on Tuesday January 19, 2021 @01:01AM (#25830501)
There was a proposal to do just that in our DIP (D improvement proposal) pipeline that nearly made it but it (probably correctly) received enormous backlash.

However, if you use @safe (that's the attribute) the compiler will hard-error if you call any code that you use that isn't explicitly also either @safe or @trusted.

There is also DIP1000 and DIP1021 which both loosen @safe semantics to perform semantic analysis to allow safe memory behaviour (A small borrow checker in effect, this will hopefully be bigger soon).

Re:Hecto: Build your own text editor in Rust by cle on Tuesday January 19, 2021 @12:48AM (#25830424)
Try accessing a struct property that isn't in the declaration, or accessing a value after it has been freed (out of scope). You'll get a compile error.

D has lots of memory safety features. It is not the same set of features as Rust. It's wildly incorrect to suggest that Rust has a monopoly on memory safety.