[m-dev.] Grade confusion

Paul Bone paul at bone.id.au
Sun Nov 16 15:24:28 AEDT 2014

On Sun, Nov 16, 2014 at 12:37:48PM +1100, Mark Brown wrote:
> On Sat, Nov 15, 2014 at 5:03 PM, Paul Bone <paul at bone.id.au> wrote:
> >
> > Hi,
> >
> > I saw this question on stackoverflow.com
> >
> > http://stackoverflow.com/questions/26916819/how-do-i-compile-for-debugging-in-mercury-programming-language/26943053#26943053
> >
> > I'm pretty sure that adding a grade flag merely adds that grade component
> > onto the default or specified grade.  So that if my default grade is hlc.gc
> > and I need to use asm_fast.gc.debug for debugging specifying --debug won't
> > do what I need.  In this case someone who reads the debugging part of the
> > user guide which instructs them to use --debug may be confused.
> >
> > A number of new users have commented on how Mercury's large number of grades
> > make things confusing, however that problem is going to take a long time to
> > solve.  In the interim, I propose changing the user guide.  Any thoughts?
> I have no idea what you are proposing to change the user guide to.

Rather than simply say "mmc --debug will enable you debugging."  It should
say that the user should choose a debugging grade and link them to the
section of the manual about compilation grades.  The problem with the manual
as it is is that "mmc --debug" sometimes works and sometimes doesn't.

> The seemingly obvious solution to your problem is for the --debug
> option to select one of the debug grades that is actually installed,
> if possible. So there could be two default grades, the usual one and
> one with debugging. Please don't tell me you think this will take a
> long time to solve.

That particular solution wouldn't take a long time technically.  It may take
longer for us to discuss and conclude what flags like --debug or --profiling
should actually do if they're no-longer grade flags.  (I have a vague
feeling that we discussed this recently.)

What will take longer is solving the more general confusion that grades
create.  This first requires us to agree that grades are confusing and
create problems.  In my experience they make things easier for language
implementors, especially people using the language for research (writing
papers about different compilation options such as parallelism or rbmm).
But it makes things harder for people who want to use Mercury to develop
their applications.  Generally for this latter group compilation options
tend to be "Do I want debugging Y/N? profiling Y/N? thread safty Y/N?"
Which is a lot less confusing than asm_fast vs hlc.  I concede however that
compilation options in mercury will always be a little bit more complicated
than other languages, for exampling whether or not someone wants trailing
will always be relevant for Mercury.

Paul Bone

More information about the developers mailing list