[MLton] funny error message

Stephen Weeks MLton@mlton.org
Tue, 27 Sep 2005 05:09:29 -0700


> >  Further subsequent errors messages are
> > generally pretty good.  So, it is clearly a win for MLton to report
> > those subsequent messages. 
> 
> No, it isn't clear: I would not want this.

I will revise my statement slightly.  It is clearly a win for MLton to
be capable of reporting multiple errors and to report multiple errors
by default.  This is true because

 * multiple errors is more efficient for most programmers 
 * multiple errors is what most programmers want
 * if one supports multiple error messages, it is trivial for those
   programmers who want only the first one to obtain it.  If one
   supports only one error message, it is impossible for those
   programmers who want many to obtain them.

> Perhaps I'm too used to Ocaml: with polymorphic variants,
> a single error can be 100-500 lines (NOT kidding).

I've seen up to maybe 15 or 20 with MLton, but the vast majority are
4-5 lines.

> Please put a switch that limits the number of errors reported!

As Matthew pointed out, it's already there.

> So people differ .. just don't assume there is no downside to
> spewing multiple errors out.

Fair enough.

> Another point: it is REALLY bad if the errors are mixed in  
> with bunch of warnings. If you stop on error, then the
> error is always (a) the only one and (b) the last diagnostic.

-error-threshold will stop on the last error.  In default mode, MLton
may print warnings before that, but I believe it is possible with
appropriate annotations to silence all warnings or turn them into
errors.