3 ms·
> But with with Swift, Rust and modern C++ the argument can be made that GC doesn't bring anything to the table. With Rust and C++ (don't know about Swift), yo
by xigoi 4y ago
> But with with Swift, Rust and modern C++ the argument can be made that GC doesn't bring anything to the table.
With Rust and C++ (don't know about Swift), you still have to spend a lot of time thinking about memory.
- zozbot234 4y ago> With Rust and C++ (don't know about Swift), you s still have to spend a lot of time thinking about memory. You don't think about memory, you just think about how to ensure that you're always referencing live objects. And you need that kind of thinking anyway to deal with non-memory resources, where a GC won't help you at all.
- tptacek 4y ago"You can't garbage collect file descriptors" is a very weak argument.
- tjoff 4y agoMy argument is that you always need to think about memory - even in GC languages. Being able to not think about memory is not a feature, it is a problem.
- germandiago 4y agoYou can just ignore it all almost as long as you stick to RAII and keep customizing allocators where you need. It is quite reasonable bc you can start to code fast and later imprpve performance in the allocation patterns. There are other ways such as customozong new/delete.
- xigoi 4y agoCustom allocators definitely count as thinking about memory. Possibly also RAII.
- germandiago 4y agoTrue. But pauses due to a GC also counts as thinking about memory... Depends on your situation what you can or cannot do/afford.