News for hackers. Stuff that matters.
Re:“Memory leaks are memory safe in Rust” by mcv on Monday January 31, 2022 @04:37AM (#30146203)
I don't think completely preventing memory leaks at the language level is possible. With reference counting, it's indeed possible to have two objects referring to each other without being referred to from the outside, but even in a garbage collection language like Java, where such objects would eventually be cleaned up, it's still possible to accidentally continue referring to data that you never intend to use again.

There's a lot that languages can do to help manage memory, but the last step will always have to come from the programmer.

Re:“Memory leaks are memory safe in Rust” by SamReidHughes on Tuesday February 01, 2022 @02:33AM (#30159616)
At some point you have to start being precise about what you mean by memory leak -- how explicit does your code have to be in how it burns its way through memory? A strictly evaluated functional language (if not a language that lacks dynamic allocation entirely) will have no cycles, but you could still blow through memory with infinite recursion. Suppose you prohibit non-tail-call recursion. You could still write code that grows a list as it executes other logic. But it's hard to do so "accidentally."