News for hackers. Stuff that matters.
Re:Would Rust have prevented Heartbleed? Another look by rdtsc on Tuesday March 17, 2015 @03:24PM (#9220593)
> Go is garbage collected, so memory leaks cannot occur.

Well it depends on how you define memory leaks. Memory leaks can of course occur logically. Like say you create objects in a cache and never remove them. It is still a memory leak.

But at the level that you define the memory leak, it seems Rust can be just as good as Go because memory ownership is tracked by the compiler. One can say it is even better because of compile time checks and no need to have a GC @ runtime present.

Re:Would Rust have prevented Heartbleed? Another look by comex on Tuesday March 17, 2015 @03:41PM (#9220742)
If you're worried about memory leaks, an obvious downside of Rust is that it encourages reference counting over GC (more accurately: has no GC, but that might change in the future), and reference counting can leak via cycles.

However, in practice most values can be neither Rc nor Gc but single-owner, like unique_ptr in C++, which is easier to reason about than either.

Re:Would Rust have prevented Heartbleed? Another look by steveklabnik on Tuesday March 17, 2015 @03:54PM (#9220870)
Yes, it's important to note that Rust isn't 'refcounting but not GC,' but single ownership + borrowing over all else, and then using refcounting if you find yourself in a situation where you need multiple ownership.