Critique my error messages! (Fennel)
I've recently put some work into adding friendly error messages to the compiler I work on for Fennel, which is a lisp. I have taken a cursory look at how Elm does compiler errors as it's arguably the best-in-class at this. Since Fennel does not have static types, it will never be able to provide as good feedback as Elm in the compiler, but it's much clearer than the old errors.
You can see a nearly-complete catalog here: https://p.hagelb.org/friendly.txt.html
I would love to hear suggestions of what could be improved. I'm considering adding multiple lines in the "problem pinpointing" but I don't have a great grasp of how to determine when multiple lines would be helpful.
Posted May 3, 2020, 11:00 PM UTC
Are you sure you want `unused variable` as an error instead of a warning? That might be bit annoying while prototyping.
Also just wondering, don't people like error messages that start with `<file>.<line>.<col>: `?
The unused variable one right now is only an error when you add a certain flag to the compiler, yeah. It's just included for completeness sake.
I've never seen any compiler that uses a dot instead of a colon for line numbers personally. But it's a good point that the current output is omitting the column number.