News for hackers. Stuff that matters.
Re:A half-hour to learn Rust by snewman on Saturday January 02, 2021 @11:06PM (#25619328)
Per Wikipedia:

> In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in a way that memory which is no longer needed is not released.

In most of your scenarios, e.g. "pushed to some queue", the object in question is still needed. Hence, this is not a leak. Presumably, the entry will eventually be removed from the queue, and GC will then reclaim the object.

At any rate, I think we're moving past the point of productive discussion. My experience in practice is that memory leaks are more common / harder to avoid in non-GC languages. Of course a true memory leak (per the definition above) is possible in a GC language, but I just don't see it much in practice. Perhaps your experience is different.

Re:A half-hour to learn Rust by tutfbhuf on Sunday January 03, 2021 @04:45AM (#25620766)
Are there any languages that provides memory leak safety, so that the compiled binary is guaranteed to be memory leak free?
Re:A half-hour to learn Rust by kaba0 on Friday January 08, 2021 @01:30PM (#25687959)
What does memory leak free mean? It has a semantic meaning.

If I have a queue with elements and I won’t be accessing some of it in the next part of the program, is it a leak? Also, remember that certain GCd languages intern strings, is it a memory leak since it will not necessarily use it anymore?

Re:A half-hour to learn Rust by tutfbhuf on Friday January 08, 2021 @02:56PM (#25689499)
Well, you would need a way to "tell" the compiler more about your intentions and maybe even explicitly declare rules for what you consider a memory leak in certain scenarios.

To provide an example for a different case: programs written in Gallina have the weak normalization property, implying that they always terminate.