3 ms·
My understanding is that garbage collection in D is performed by a "stop the world" non-generational collector. Although GC is optional in D, without a more com
by hashmash 3y ago
My understanding is that garbage collection in D is performed by a "stop the world" non-generational collector. Although GC is optional in D, without a more competitive implementation, the safest thing is to never depend on it. What advantage does D then have over languages like Rust and Zig?
- keep_reading 3y agoC/C++ interop and easy static linking makes it super nice for writing small utilities IMO
- Alifatisk 3y agoAre there GC's that doesn't halt the execution actively in use?
- WalterBright 3y agoD's garbage collector is quite safe. Most non-trivial programs use a mix of stack allocation, RAII, malloc-style allocation, and GC. Each style has aspects they're best at. GC is particularly well-suited when using compile time function evaluation, which executed D code at compile time (i.e. adanced constant folding, where functions can be called).
- hashmash 3y agoMy remark regarding "safety" wasn't with respect to the quality or correctness of the implementation. My concern is the case where you've found yourself in a situation where you're relying too much on GC, and the application is experiencing long pauses. Changing the design to rely more on manual allocation is one way out, but having more GC choices would be nice too.