3 ms·
I… I just got corrected by Walter Bright. 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 excell
by PeCaN 10y ago
I… I just got corrected by Walter Bright.
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.
- WalterBright 10y agoD 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.
- PeCaN 10y agoInteresting, 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).