4 ms·
D is a beautiful language. However, its embrace in the 1990's of garbage collection has proved its Achilles heel. Before anyone says you can write D without th
by RcouF1uZ4gsC 3y ago
D is a beautiful language.
However, its embrace in the 1990's of garbage collection has proved its Achilles heel. Before anyone says you can write D without the garbage collection, yes you can but then you lose access to most of the standard library, and likely most third party libraries. Rust and C++ allow you not to have to use garbage collection but still use the standard library and 3rd party libraries.
With garbage collection, D is not directly competing not with C++ but with Java, Swift, Go, C# which have far more support across the industry.
- Alifatisk 3y agoIt is indeed a beautiful language, what makes the GC such a no-no? Hard to work with in embedded systems?
- mhh__ 3y agoOpposition to GC is mostly people being fooled by GC-ed languages tending to be higher level and thus generating more garbage. > Embedded systems In the embedded work I've done I barely allocate at all, so it matters not GC or otherwise.
- daaaaaaan 3y agoSwift doesn't have garbage collection.
- RcouF1uZ4gsC 3y agoRefcounting is a form of garbage collection. While C++ and Rust also have refcounting, it is the default memory management mode in Swift in a way that it is not in C++ and Rust (where the defaults are more using stack based or unique_ptr/Box before reaching for refcounting).
- daaaaaaan 3y agoNo, it's not. Refcounting CAN be a garbage collection algorithm, but in Swift it's deterministic and done at compile time. Not to mention recently added support for non-copyable types that enforces unique ownership: https://github.com/apple/swift-evolution/blob/main/proposals/0390-noncopyable-structs-and-enums.md https://github.com/apple/swift-evolution/blob/main/proposals...
- WalterBright 3y ago> you lose access to most of the standard library That's simply not true. Only one of the algorithms in std.algorithm, for example, uses the GC. The GC also enables much better compile time function execution.
- MikeShah 3y agoIt's worth noting many (A majority as I understand) AAA game studios end up writing their own STL. I'm willing to bet many industries where performance is the primary concern also write much of their core libraries from scratch. D lets user opt-out of collector as needed which is quite nice. D has been used in AAA game development for what it's worth as well.