5 ms·
> Contrast this with Rust whose errors read like mind-bindingly inscrutable tax forms. It was "lol what?" for me. Rust's compiler error messages are very infor
by EugeneOZ 10y ago
> Contrast this with Rust whose errors read like mind-bindingly inscrutable tax forms.
It was "lol what?" for me. Rust's compiler error messages are very informative and sometimes contains tips what to change in your code to make it work (not just general words, but code you can use right now, with your variables/functions etc.).
Borrow checker explains step-by-step where ownership starts, where it ends and where you are trying to use it.
Panicking messages - another story, but it's not compiler's error messages, it's runtime. In example of code Adam using as proof, author is using 'panic' and 'unwrap' - reasons to don't expect gentle behavior.
If you can't write code in idiomatic way, try to catch your panics and give more descriptive runtime error message in your code - other users of language shouldn't pay for it.
- valarauca1 10y agoThis was where I stopped reading. The author clearly hasn't worked with Rust. Not only are the messages very descriptive, but you have an extended explaination for each error in the form of: rustc --explain EXXX Which pulls up a long form explaination, and code samples of what is happening/why it is happening/how to fix it. The blog explaining the author's disdain for Rust mostly just seems to whining about the borrow checker.
- masklinn 10y ago> The author clearly hasn't worked with Rust. The author links to a previous post on the subject, from mid-2015, so they clearly have at least tried Rust in the past. And while many Rust messages are OK, one should be careful not to confuse familiarity with Rust's error messages[0] with Rust's error messages being good (being inherently informative and good). Here's a clearer example (fixed since): http://dbeck.github.io/My-First-Steps-In-Rust/ http://dbeck.github.io/My-First-Steps-In-Rust/ note two issues: * the error message is busy as all hell which is a common issue in Rust, before you've built the habit and learned how they're structured Rust error messages often look daunting. By comparison Elm makes much more extensive use of spacing and tries to avoid repeating the same information (e.g. file names) over and over. * the suggestion it provides is just plain wrong, it suggests implementing Debug for T, but T is always a standard number which already implement Debug, what's missing is a trait bound. To a beginner that was not a helpful suggestion as it would only send them on a wild goose chase (of trying to implement Debug on either T or i32/f32, and good luck with those). > The blog explaining the author's disdain for Rust mostly just seems to whining about the borrow checker. So? Just like monads in haskell, the borrow checker is hard until it "clicks" (and then it fundamentally shifts your understanding and it becomes hard to understand not getting it). [0] and experience/understanding for the various possible sources of the most common ones, but that you can build for any compiler, even G++'s pages of template expansion garbage from the early aughts
- EugeneOZ 10y agoSo are you talking about error messages or about complexity of borrow-checker? Because I can agree about borrow-checker, but not about error messages (although there is a lot of noise, yes).
- masklinn 10y ago> So are you talking about error messages or about complexity of borrow-checker? Er… both? In separate sections of the comment? > Because I can [not agree] about error messages I've provided a clear example of an issue, are you denying objective reality or are you asserting that providing incorrect suggestions leading beginners in entirely the wrong direction is fine?
- EugeneOZ 10y agoSo you are trying to add some negative moment about borrow-checker, when my comment is not about borrow-checker, but you need something negative. Cheap trick.
- masklinn 10y ago> So you are trying to add some negative moment about borrow-checker, when my comment is not about borrow-checker, but you need something negative. Cheap trick. Now what the hell are you talking about? I didn't reply to your comment I replied to valarauca1, they're the one who mentioned the borrow checker, if you're unhappy about that whine to them don't include me in your pity party.
- EugeneOZ 10y agoAre you drunk? You are responding to the branch my comment started, comment was about error messages and your response contain words: "And while many Rust messages are OK, one should be careful not to confuse familiarity with Rust's error messages[0] with Rust's error messages being good (being inherently informative and good)." So you will still try to pretend we are not talking about error messages here?
- MaulingMonkey 10y agoBad macro matches can sometimes result in some rather obtuse error messages, and the exact root cause of some of the type mismatch errors can also be relatively obtuse - at least to a beginner. Still way better than C or C++'s though, I suspect. (I'm too fluent in C++ errors to have a proper feel for how bad they are anymore...)
- valarauca1 10y agoMacro errors are horrible, especially in match branching. They also become really nonsensical when you deal with built in macro's as well which have a completely different set of rules for themselves. Iterator errors as well get massive when dealing with passing tuples down lazy lists.
- gnuvince 10y ago> The blog explaining the author's disdain for Rust mostly just seems to whining about the borrow checker. Most (negative) discussions about Rust are about the borrow checker. I sometimes wonder if people dislike it because it makes them feel the same way they felt the first time they learned to program and the compiler would never accept their code.
- deleted 10y ago[deleted]
- steveklabnik 10y agoIt's worth noting that the Rust project itself doesn't consider our current error setup as good as it could be. Set "RUST_NEW_ERROR_FORMAT" to get a preview of what we've been working on. I do like the current errors, but that's no reason to rest on our laurels! There's a lot of ways in which they're not great.
- ahl 10y agoThe author (me) isn't a Rust expert, but has played with it a bit. Rust, I think, suffers from a lack of empathy with a novice audience. I'm a big fan of Rust and I think it introduces some novel, valuable, and fascinating new concepts. It should be taught in every CS program alongside procedural, OOP, and functional programming. Once you understand the paradigms, Rust error messages make sense. It's like the folks who describe git by starting with a exposition on merkel trees: technically precise, but incomprehensible if you only know cvs.
- steveklabnik 10y ago> Rust, I think, suffers from a lack of empathy with a novice audience. I'd be interested in hearing more about this. Do you mean a novice to Rust, a novice to low-level programming, a novice to programming in general? We're actively working on fixing up errors to be even better, so hearing about specifics here would be quite valuable!
- valarauca1 10y ago>Rust, I think, suffers from a lack of empathy with a novice audience. The borrow checker is the simplest thing once you internalize it's rules. Just the road to breaking all the bad habits C/C++ teach you are fine over the years takes a while. And most these rules are mostly excessive and unnecessary coming from a C perspective. The borrow checker is kind of like type systems. It prevents a whole class of errors, but you lose the ability to express some perfectly valid code. It is really a kind of mental-quantum-leap. Once you internalize it's rules you really lose the ability to understand how other people can't. Also to deflect some blame from The Rust-Community. I'm just kind of a horrible person on the internet. I'm working on improving :\ Sorry for the coarse comment.
- nutheracc 10y agoYes, agreed, the Rust error messages are very helpful. Failure to understand the messages is a lack of familiarity with Rust, not a problem with the error messages.
- masklinn 10y ago> Failure to understand the messages is a lack of familiarity with Rust You could have said the exact same thing of G++'s pages of template error messages. That's indictment not praise. If you must be highly familiar with the language to understand the compiler's error messages you might as well remove the messages altogether and just print "?" as ed(1) does, developers familiar with the language obviously don't need them and beginners apparently aren't allowed to understand them so why even bother? (good thing the Rust developer team disagrees with your vision of the subject).
- EugeneOZ 10y agoYou are trying to catch on words, but it's just not true. I went my way from the 0-noob in Rust to comfortable using and I can say compiler errors were always helpful. Always. From the very beginning of my journey.
- masklinn 10y ago> You are trying to catch on words No. I'm clearly replying to a clear opinion, there's no catch although I might be exaggerating very slightly. > but it's just not true. What is not true? > I went my way from the 0-noob in Rust to comfortable using and I can say compiler errors were always helpful. That's got nothing to do with the comment you're replying to.
- Onewildgamer 10y agoTo me, an error message should help in understanding the language better. It shouldn't impose a requirement to have the knowledge beforehand.
- 10y ago