Re:For Better Computing, Liberate CPUs from Garbage Collection
by mafribe on Thursday May 09, 2019 @04:33AM
(#19866412)
I'd be interested to learn why you think this is possible. As you point out yourself, by Rice's theorem, precise lifetimes are not statically decidable. Rust's lifetimes are essentially based on nesting (think well-balanced brackets) and tracked by enriching the standard Damas-Hindley-Milner approach with a notion of affin-ness which is a weakening of Girard's linearity. Circular data structures immediately violate affine-ness. What mechanism do you propose to get around this conundrum?
[ Parent
| on HN ]
Re:For Better Computing, Liberate CPUs from Garbage Collection
by lllr_finger on Thursday May 09, 2019 @09:11AM
(#19867928)
"All" might not be possible, but every Rust release tends to see improvements in lifetime elision. I just went through a few Rust apps I wrote 6 months ago and was able to get rid of nearly every explicit lifetime annotation thanks to improvements.
So there's definitely room for improvement, but also good progress being made.
Re:For Better Computing, Liberate CPUs from Garbage Collection
by Hercuros on Thursday May 09, 2019 @05:27AM
(#19866652)
I think that for function definitions in Rust you would in principle be able to leave out lifetime annotations on arguments/return values in more cases than is currently allowed by lifetime elision. I believe they don't allow this since it can become very confusing if the lifetimes are not written out when there are multiple references arguments. I'm not entirely sure about this, though.