[...] Rust’s rules around lifetimes [though] usually framed in the public consciousness as “a way to avoid garbage collection,” [...] are a much deeper and more significant construct than that. They are [...] an incredibly powerful tool for understanding the behavior of the system because you can analyze [it] locally: you never need to worry about “spooky action at a distance.” And you can do so without manually reconstructing imperative control flow with monads. As I’ve written several times before: monads are a clever way to show you can program without mutation; lifetimes are an even cleverer way to show you can just use mutation.
This is the single "deepest" lesson that I feel like I've learned about Rust so far. Lifetimes, stumbled upon while trying to avoid (runtime) garbage collection, are in fact a more general tool for delimiting behavior/causality in programs.
I’m not saying that Rust’s solution is perfect. Indeed, lifetime syntax is arcane and confusing to users. But I think any solution that claims to beat Rust should provide the same level of guarantee or indeed better: ideally new languages would allow for imperative programming without any shared mutable state at all.
Similarly, this aligns with my current opinion of rust vs other programming languages for tasks that are not inherently unsuited to Rust's current state.
I'm not sold on the idea of "imperative programming without any shared mutable state at all". Maybe I just can't accurately imagine what that would look like in practice.