Hacker News new | past | comments | ask | show | jobs | submit login

> As for compiler errors not helping you understand the problem, I have yet to encounter a compiler that does that.

Not very mainstream, but take a loot at elm's compiler errors [1]. They worked hard in this direction, and the result is both helpful and beautiful.

You can try loading up any of the examples in the online editor [2] and introducing a random bug, just to see how the compiler <del>barks</del> tries to gently teach you.

[1] http://elm-lang.org/blog/compiler-errors-for-humans

[2] http://elm-lang.org/examples




Rust's error messages are (well, try to be) similar, and in fact explicitly inspired by Elm: https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-com...


I think my point was that they may teach you if you already have some fundamental knowledge (or help remind you of the rules anyway) but they're not instructive in and of themselves (you could copy-paste the suggestion to "fix" your problem quickly but that's not really increasing your understanding I think).


The error message catalogue [1] mentioned at the end of that first blog is interesting, wonder if Rust would benefit from something similar.

[1] https://github.com/elm-lang/error-message-catalog


Rust has a strong policy of adding tests when adding/changing code, so almost all error messages are tested in some form, including "UI" tests, that check the exact formatting.

Additionally, there's https://doc.rust-lang.org/error-index.html




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: