[Haskell-cafe] Haskell grammar ambiguity

Tom Ellis tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk
Wed Jun 16 09:00:41 UTC 2021


On Wed, Jun 16, 2021 at 09:48:06AM +0200, Sven Panne wrote:
> Am Mi., 16. Juni 2021 um 08:47 Uhr schrieb Li-yao Xia <lysxia at gmail.com>:
> > [...] - An ambiguous grammar may be more readable (since there are
> > strictly
> > more choices available), especially if you care more about the AST than
> > the concrete syntax. [...]
> 
> IMHO it is exactly the other way around: I consider ambiguous
> grammars a serious usability bug. [...] The BlockArguments proposal
> introduced lots of additional ambiguities, and that's the reason why
> I'm still opposed to it.
>
> [...]
>
> In general, I consider it a very bad idea to give more and more strings a
> meaning as a program: Some redundancy, like keywords and/or punctuation, is
> highly useful as a human reader. Remember the old saying "A good language
> should not make it easy to write correct programs, it should make it hard
> to write incorrect ones", and BlockArguments was IMHO a step into the wrong
> direction.

Entirely agreed.  The additional difficulty in parsing means that
BlockArguments provides *negative* value to me, even if I don't enable
it:

http://h2.jaguarpaw.co.uk/posts/unhelpful-ghc-error-messages/

Tom


More information about the Haskell-Cafe mailing list