4 ms·
We put more effort into error messages than almost any language I know of, except Elm and Haskell dialects. A huge fraction of rustc commits are tweaking error
by pcwalton 11y ago
We put more effort into error messages than almost any language I know of, except Elm and Haskell dialects. A huge fraction of rustc commits are tweaking error messages for ease of use.
Rustc error reporting was deliberately based on that of clang.
In particular, I think it is going to be impossible to have error messages for lifetime errors that are solvable without doing at least some background reading.
- Fede_V 11y agoI can only offer my point of view as a complete rust novice. Lifetimes are the most intriguing and new aspect of programming in rust - this unfortunately means that when people first start with the language and they run into non-obvious errors, they will need a little handholding. Google/stackoverflow of course help, but, as an expert, I think you may be a bit biased by your own experience as to how helpful the compiler errors actually are.
- masklinn 11y ago> Lifetimes are the most intriguing and new aspect of programming in rust - this unfortunately means that when people first start with the language and they run into non-obvious errors, they will need a little handholding. I genuinely have no idea how you'd even go around improving lifetime errors, if somebody manages to crack that one I'd probably be willing to set up a recurring donation to whatever they wish.
- steveklabnik 11y agoThere's been at least one promising idea floating around: using an IDE to draw out lifetimes, so you can see how they overlap. Something like slides 172/173 of http://www.slideshare.net/nikomatsakis/rust-mozlando-tutorial http://www.slideshare.net/nikomatsakis/rust-mozlando-tutoria...
- Fede_V 11y agoThat would be fantastic!
- pcwalton 11y agoWell, sure, but it's not that nobody was paying attention to lifetime error messages. It's that it's really hard, maybe impossible, to make lifetime error messages make sense for those who are unfamiliar with lifetimes.