News for hackers. Stuff that matters.
Re:Rust – A hard decision pays off by Too on Wednesday August 24, 2022 @11:57PM (#32589312)
For those not familiar with ownership concepts, it does apply to many things beyond just memory management. Most obvious example of this is file handles. In python you have to close() them or scope within a context manager to auto close when the block exits. If you need more complex logic around, such as transfer the handle into another function, the context manager is no longer sufficient and you quickly loose track of who should call close(), is it the caller or the callee.

Rust keeps track of this, no matter how deep you twist your logic and it does so for every variable, no context manager blocks required.

There are no comments on this comment yet.