4 ms·
Because it's "optional". Some of D's features (https://dlang.org/spec/garbage.html#op_involving_gc https://dlang.org/spec/garbage.html#op_involving_gc) depend o
by forgotpwd16 4y ago
Because it's "optional". Some of D's features (https://dlang.org/spec/garbage.html#op_involving_gc https://dlang.org/spec/garbage.html#op_involving_gc) depend on it. It's optional in terms of you cannot use those. But if it's to never use them, why they even exist?
- WalterBright 4y agoThe GC is very nice for evaluating functions at compile time. It has zero runtime cost.
- tristanbvk 4y agoHow would one go about instantiating an object in D without GC if the new keyword relies on it. Accounting for memory allocation and object initialization (construction etc)? Legit question coming from a D enjoyer
- WalterBright 4y agoThe compile time function execution enables allocation with `new` and it handles initialization, etc.
- tristanbvk 4y agoThanks Walter!