Hacker News new | ask | show | jobs
by pjmlp 4244 days ago
Really?! Mozilla even has a memory leaks tooling tracking page:

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.

2 comments

Rust 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.
Rust 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.
I'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.
Yes, I am following it quite closely.

However it does place a bit of cognitive burden, but last version already improved it.

> 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
Raw pointers is the last item on your list after RC pointers.
From 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.
> 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.