4 ms·
Since it's optional, why does it matter that much?
by self_awareness 4y ago
Since it's optional, why does it matter that much?
- forgotpwd16 4y agoBecause 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!
- p0nce 4y agoIt doesn't. It just got posted here.