Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, your options are unsafety, garbage collection (in the broad sense, which includes Rc), and hiding lifetimes from the compiler via "handles" or similar.

Can you even imagine other options, though? If enough information about the lifetimes isn't known at compile time, how can the compiler prove it safe?



It's very rare that a serious problem can be solved without some objects having some sort of a dynamic lifetime that you have to manage.

Rust just prevents you from doing this. So you can say it provides safety, but it also restricts you from solving the vast majority of serious problems that we write programs to solve.

This is very different from static vs dynamic typing.

In a statically typed language, the compiler actually _knows_ what you can and can't do with each object.

Where as Rust's life time management just says "Nope, I have no idea whether what you are doing is safe or not so I'm just going to tell you you can't do it".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: