[MLton] funny error message

Stephen Weeks MLton@mlton.org
Mon, 26 Sep 2005 14:08:48 -0700


> > If we stopped here, all would be well.  But, since MLton likes to
> > report as many errors as possible, 
> 
> MLton may be slow .. but it is no longer a question of
> overnight turnaround and printed diagnostics.
> 
> I'm not sure what you mean by 'report as many errors as possible',
> but literally taken this is a very bad idea

Fair enough.  What I meant was that it is worth it to report more than
one error.  MLton does stop after some point without processing the
entire rest of the program.

> When you find an error, it may be necessary to 'unwind' the call
> chain until there is enough context to report the error sensibly
> .. but you should *never* continue!

Continuing vs not continuing isn't strictly a case of being right or
wrong.  But in the case of MLton you're wrong.  :-)

It is an engineering question trading off time to get error messages
versus quality of possibly spurious subsequent error messages.  If one
uses MLton for any length of time, one quickly learns that it takes a
long time before the first type error is reported, and no time at all
for subsequent errors.  Further subsequent errors messages are
generally pretty good.  So, it is clearly a win for MLton to report
those subsequent messages.  Personally, I often use MLton on itself, a
>100K line program that sometimes takes 30 seconds before the first
type error is reported.  In this situation and others, I often
successfuly process 5-10 error messages in a batch with no difficulty.
I and other MLton users would needlessly waste a lot of time if we had
to recompile for each error.

If someone wants to use MLton and only ever read the first message
they can.