News for hackers. Stuff that matters.
Re:Using Rust in Mercurial by Rusky on Monday December 04, 2017 @09:49PM (#15849390)
> C only has 2 lifetimes: block scope for stack variables, forever (until explicitly free'd) for heap malloc'ed memory.

To the contrary, C has just as many lifetimes as Rust. They're just not explicit. "free() it when you don't need it any more" is a complex problem and C doesn't really help you solve it at all.

> Everything is passed by value (copy) and you can only pass simple objects (plus structures), for anything else you pass the value of the address of the object, end of story.

That's how Rust works as well.

There are no comments on this comment yet.