Re:PowerNex: a kernel written in the D Programming Language
by WalterBright on Saturday June 25, 2016 @02:53AM
(#11975511)
D does have @safe, which does a good job of preventing large classes of unsafe pointer issues. It is not perfect yet (we're working on it) but it is far better than "nothing like", and far better than C/C++.
For example, it does array bounds checking.
Re:PowerNex: a kernel written in the D Programming Language
by PeCaN on Saturday June 25, 2016 @12:52PM
(#11976947)
Interesting, I didn't know about @safe. I need to study D more!
At the moment I'm pretty happy with OCaml and learning Rust, but D definitely has me interested (especially when the no-GC stdlib completes).
That's true. You actually can write an RTOS in D, and it would still be more pleasant than in C (thanks to D's excellent metaprogramming). The problem I have with opt-out GC in D is that it leaves you with very little else as far as memory safety goes—you have RAII, but nothing like Rust or Cyclone or other languages that are explicitly safe without a GC. You can leak, you can crash, you can have race conditions, etc, almost as easily as in C. Some sort of D version of unique_ptr would get you part of the way there, but it's still not as complete as Rust.