7 ms·
> Time has proven again and again that humans are really bad at memory management Well until AI write garbage collectors I'm not sure I see how your comment do
by swartkrans 12y ago
> Time has proven again and again that humans are really bad at memory management
Well until AI write garbage collectors I'm not sure I see how your comment doesn't also apply to them. And lots of great software manages memory quite fine, like that browser you used to write your comment and the operating system it runs on, so not sure the use of "proven" is appropriate in your comment.
- taspeotis 12y ago> And lots of great software manages memory quite fine, like that browser you used to write your comment Which bit of the browser are you talking about? Garbage collection is used extensively during the execution of JavaScript in a lot of browsers. For example, Chrome [1]. [1] https://developer.chrome.com/devtools/docs/javascript-memory-profiling https://developer.chrome.com/devtools/docs/javascript-memory...
- rtpg 12y agoI think we've all used software that suffers from some pretty intense memory leaks ( including older versions of firefox!), and garbage collectors can be "good enough" for a huge amount of applications. Most applications are _not_ games or web browsers, but enterprise-y CRUD applications. I'm fine with having the ability to turn that off for specific things, but it should be made as inconvenient as possible to avoid the "Can't have GC pauses in my todo list" usecase.
- pjmlp 12y agoReally?! Mozilla even has a memory leaks tooling tracking page: https://developer.mozilla.org/en-US/docs/Mozilla/Performance https://developer.mozilla.org/en-US/docs/Mozilla/Performance And are making Servo in Rust, which uses compiler dataflows form memory management. Apple has added ARC to Objective-C and Swift. Microsoft uses GC in .NET, ARC in C++/CX. Modern C++ favors RC. They all seem to think manual memory management is to be avoided.
- pcwalton 12y agoRust shows that "between having GC pauses and having memory leak continuously (and buffer overflow issues which become security issues) I'll take GC pauses" is a false dichotomy, however.
- pjmlp 12y agoYes, I am following it quite closely. However it does place a bit of cognitive burden, but last version already improved it.
- ZeroGravitas 12y agoRust is one of the coolest things in programming at the moment, but if you have to invent your own programming language to cut this gordian knot, then it's not really a false dichotomy for most practical purposes. And it'll stay a genuine dichomoty until Rust (or something like it) is a mainstream choice.
- rtpg 12y agoI'm glad for the advances in Rust. My comment was meant in the context of the current state of the art (Java/C++ like). If we move forward enough the GC questions could be a thing of the past.
- dbaupp 12y ago> Modern C++ favors RC. Does it? I was under the impression that the order of preference (from most preferred to least) is something like: - plain values (i.e. no pointers) - references - unique_ptr - shared_ptr - raw pointers
- pjmlp 12y agoRaw pointers is the last item on your list after RC pointers.
- dbaupp 12y agoFrom this response, I guess that maybe you were meaning C++ favours RC compared to manual memory management, and were not saying that it is the globally preferred option, but this differs to everything else in your list: the others are the main/preferred strategy in those languages/libraries.
- pjmlp 12y ago> I guess that maybe you were meaning C++ favours RC compared to manual memory management, Yes. > the others are the main/preferred strategy in those languages/libraries. While true, manual memory management is still possible, but should be left for the 1% cases that really benefit from it.
- baddox 12y agoPresumably the humans writing popular garbage collectors are significantly better at memory management than the average programmer. You wouldn't say that humans shouldn't go to doctors until there are AI doctors.