Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal to move grammar related part of error messages behind a runtime flag #5585

Closed
p6rt opened this issue Aug 17, 2016 · 6 comments
Closed
Labels
RFC Request For Comments

Comments

@p6rt
Copy link

p6rt commented Aug 17, 2016

Migrated from rt.perl.org#128969 (status was 'rejected')

Searchable as RT128969$

@p6rt
Copy link
Author

p6rt commented Aug 17, 2016

From @MasterDuke17

Paraphrasing from IRC where my first comment starts here​: http://irclog.perlgeek.de/perl6/2016-08-17#i_13035789

My feeling has always been that Perl 6's errors are good, but I'm sympathetic to whoever it was that complained that the list of "expecting any of" things wasn't all that helpful in the general case. Personally, I have never once gotten any useful information out of them, but the messages that precede them are very helpful. E.g., perl6 -ne '.say if /asdf \s+ \/' gives the error message​:

===SORRY!===
Regex not terminated.
at -e​:1
------> .say if /asdf \s+ \/⏏<EOL>
Unable to parse regex; couldn't find final '/'
at -e​:1
------> .say if /asdf \s+ \/⏏<EOL>
  expecting any of​:
  infix stopper

The first two parts are really helpful, but the "expecting any of" I ignore. I understand that people doing fancy grammar related things probably do find them very useful. However, my impression is that most people "in the wild" writing Perl (5 or 6) are frequently doing command line text manipulation and things like that (akin to my example). And for them, the first part of the error message is extremely useful and the second part isn't (IMHO).

So I propose turning the second part (i.e, "expecting any of" and things like that) off in the general case and adding a flag to turn it on (--grammar-errors?), like we already have for --ll-exceptions.

@p6rt
Copy link
Author

p6rt commented Aug 18, 2016

From @MasterDuke17

Another suggestion would be to leave them as is unless you're running with
'-e' (though again with an option to turn them on in that case if you so
desire).

On Tue, Aug 16, 2016 at 9​:25 PM, perl6 via RT <perl6-bugs-followup@​perl.org>
wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
"[RFC] Proposal to move grammar related part of error messages
behind a runtime flag",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #​128969].

Please include the string​:

     \[perl #&#8203;128969\]

in the subject line of all future correspondence about this issue. To do
so,
you may reply to this message.

                    Thank you,
                    perl6\-bugs\-followup@&#8203;perl\.org

-------------------------------------------------------------------------
Paraphrasing from IRC where my first comment starts here​:
http://irclog.perlgeek.de/perl6/2016-08-17#i_13035789

My feeling has always been that Perl 6's errors are good, but I'm
sympathetic to whoever it was that complained that the list of "expecting
any of" things wasn't all that helpful in the general case. Personally, I
have never once gotten any useful information out of them, but the messages
that precede them are very helpful. E.g., perl6 -ne '.say if /asdf \s+ \/'
gives the error message​:

===SORRY!===
Regex not terminated.
at -e​:1
------> .say if /asdf \s+ \/⏏<EOL>
Unable to parse regex; couldn't find final '/'
at -e​:1
------> .say if /asdf \s+ \/⏏<EOL>
expecting any of​:
infix stopper

The first two parts are really helpful, but the "expecting any of" I
ignore. I understand that people doing fancy grammar related things
probably do find them very useful. However, my impression is that most
people "in the wild" writing Perl (5 or 6) are frequently doing command
line text manipulation and things like that (akin to my example). And for
them, the first part of the error message is extremely useful and the
second part isn't (IMHO).

So I propose turning the second part (i.e, "expecting any of" and things
like that) off in the general case and adding a flag to turn it on
(--grammar-errors?), like we already have for --ll-exceptions.

@p6rt
Copy link
Author

p6rt commented Sep 7, 2016

From @AlexDaniel

On 2016-08-18 07​:51​:47, ddgreen@​gmail.com wrote​:

Another suggestion would be to leave them as is unless you're running
with
'-e' (though again with an option to turn them on in that case if you
so
desire).

Can you elaborate a little bit? For example, why would I care less about this section in error messages when I'm using -e ? Or why would I suddenly need it when I'm executing a file?

@p6rt
Copy link
Author

p6rt commented Sep 7, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 13, 2017

From @zoffixznet

On Tue, 16 Aug 2016 18​:25​:28 -0700, ddgreen@​gmail.com wrote​:

Paraphrasing from IRC where my first comment starts here​:
http://irclog.perlgeek.de/perl6/2016-08-17#i_13035789

My feeling has always been that Perl 6's errors are good, but I'm
sympathetic to whoever it was that complained that the list of
"expecting any of" things wasn't all that helpful in the general case.
Personally, I have never once gotten any useful information out of
them, but the messages that precede them are very helpful. E.g., perl6
-ne '.say if /asdf \s+ \/' gives the error message​:

===SORRY!===
Regex not terminated.
at -e​:1
------> .say if /asdf \s+ \/⏏<EOL>
Unable to parse regex; couldn't find final '/'
at -e​:1
------> .say if /asdf \s+ \/⏏<EOL>
expecting any of​:
infix stopper

The first two parts are really helpful, but the "expecting any of" I
ignore. I understand that people doing fancy grammar related things
probably do find them very useful. However, my impression is that most
people "in the wild" writing Perl (5 or 6) are frequently doing
command line text manipulation and things like that (akin to my
example). And for them, the first part of the error message is
extremely useful and the second part isn't (IMHO).

So I propose turning the second part (i.e, "expecting any of" and
things like that) off in the general case and adding a flag to turn it
on (--grammar-errors?), like we already have for --ll-exceptions.

Thanks, but the PR was rejected.

I don't think the added maintenance burden and extra option the users have to read through justify the presence of this very minor feature that might not be desired by all.

We have since implemented `RAKUDO_EXCEPTIONS_HANDLER` env var[^1] that lets users use custom classes for error reporting (that allow filtering for custom handling for just specific exceptions; letting default handler handle the rest). So there's a possibility of implementing this feature entirely in a module; or expanding the idea further​: `Exceptions​::Simple` for example that give just the basics.

[1] https://docs.perl6.org/programs/00-running#Error_Message_Verbosity_and_Strictness

@p6rt
Copy link
Author

p6rt commented Apr 13, 2017

@zoffixznet - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request For Comments
Projects
None yet
Development

No branches or pull requests

1 participant