3 ms·
I heard this brilliant summary in a video from ThePrimeagen: In Rust, lifetimes color your types, like async colors your functions. It is a great condensed su
by j1elo 3y ago
I heard this brilliant summary in a video from ThePrimeagen:
In Rust, lifetimes color your types, like async colors your functions.
It is a great condensed summary of what makes lifetimes a great difficulty of async Rust. It's a language that has the function coloring that is typically introduced by async (likewise in JavaScript), and on top of that the typesystem itself gets colored by lifetime annotations. You can have a well written and working program... then due to some new need or refactoring, wanting to add a 'static somewhere will cause it all to break down.
It's part of the language, nothing bad with that. But it is an extra layer of difficulty that needs to be mastered. To me it shows that Rust might only be the initial step towards future programming languages where this kind of issue doesn't lean so much on developer knowledge.
- rcarr 3y agoCan you post a link to this video? Sounds interesting
- justincredible 3y ago[dead]