Discussion:
[m-dev.] Grade confusion
Paul Bone
2014-11-15 06:03:49 UTC
Permalink
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?
--
Paul Bone
Mark Brown
2014-11-16 04:53:19 UTC
Permalink
On Sun, Nov 16, 2014 at 12:53 PM, Zoltan Somogyi
<http://www.mercurylang.org/list-archives/reviews/2014-September/017300.html>.
Oh, right. I see you have already suggested the "seemingly obvious"
solution. :-)
Yes. We came to a consensus on the concept, but
(a) we did not *quite* get to a concrete proposal, which would
have to include transitional arrangements, and
For the --debug flag, we could just add a fallback rule to select the
best match if the grade that would be selected according to existing
rules is not installed. We'd have to explain what we mean by "best",
though. Alternatively, or additionally, we could add a
--with-default-debug-grade flag at configuration time, which would act
as another fallback rule in the same way that --with-default-grade
does.

Likewise for --trailing, etc. By this method the only users affected
would be users whose builds don't currently work, so I don't see a
great need for any transitional arrangements.

We don't quite have a concrete proposal on what is meant by "best",
but I'll be happy with anything that you think is sensible.
(b) noone volunteered to either write such a proposal, or
implement it once it has been discussed and accepted.
I am now volunteering. I will do this next week, unless
someone has already started work it.
Paul, good luck with the surgery tomorrow.
Yes, and wishing you a quick recovery, too.

Cheers,
Mark.
Mark Brown
2014-11-16 14:24:28 UTC
Permalink
Post by Paul Bone
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.
That sounds like a problem with the implementation to me. I think it
should behave as section 7.1 suggests.

Does the documentation say anywhere that the --debug flag merely adds
the .debug grade component?
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.
We first need to agree what problem we are discussing. The user you
actually cited doesn't appear to be confused about grades; they're
just wondering why --debug doesn't work the way section 7.1 suggests
it would.

Cheers,
Mark.
Paul Bone
2014-11-23 05:36:34 UTC
Permalink
Post by Mark Brown
Post by Paul Bone
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.
That sounds like a problem with the implementation to me. I think it
should behave as section 7.1 suggests.
I agree, this would be best.
Post by Mark Brown
Does the documentation say anywhere that the --debug flag merely adds
the .debug grade component?
Note that I'm aware.
Post by Mark Brown
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.
We first need to agree what problem we are discussing. The user you
actually cited doesn't appear to be confused about grades; they're
just wondering why --debug doesn't work the way section 7.1 suggests
it would.
Agreed, I editorialised and assume that this problem is part of the more
general problem of having many compiliation grades which are combinations of
grade componenets.
--
Paul Bone
Paul Bone
2014-11-16 04:26:29 UTC
Permalink
<http://www.mercurylang.org/list-archives/reviews/2014-September/017300.html>.
Yes. We came to a consensus on the concept, but
(a) we did not *quite* get to a concrete proposal, which would
have to include transitional arrangements, and
(b) noone volunteered to either write such a proposal, or
implement it once it has been discussed and accepted.
Thanks, I remembered the discussion but didn't remember where we left it.
I am now volunteering. I will do this next week, unless
someone has already started work it.
Thanks Zoltan. I will help by reading and providing any feedback. I'm also
happy to review code or help with implementation as time permits.
Paul, good luck with the surgery tomorrow.
Thanks.
--
Paul Bone
Loading...