←back to thread

177 points signa11 | 1 comments | | HN request time: 0.209s | source
1. melodyogonna ◴[] No.42162250[source]
It's interesting how Mojo solves some of Rust's lifetime UX issues. Because Mojo values uses ASAP destruction rather scope-based destructor, what Mojo's lifetime has to do is correctly track the last place a value was used, it doesn't track the validity of a scope.

What this means in practice is that Mojo's lifetime checker extends the life of values. Just point it at an origin and it'll ensure the origin is still alive wherever you use the value attached to it.

It completely defines away "value does not live long enough" compiler problems.