haskell / rfcs

This repo is archived, consider using https://github.com/ghc-proposals/ghc-proposals instead
98 stars 17 forks source link

Grammar token abbreviation #25

Closed sollyucko closed 5 years ago

sollyucko commented 5 years ago

RFC proposal (draft?)

svenpanne commented 5 years ago

Hmmm, with these renamings https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/parser/Parser.y and the spec would get out of sync, which would really be a pity.

Personally I find the abbreviated names much more readable than the long monsters, but this is probably only a personal preference. Compactness has its value, because you can grasp the structure of the productions more easily. There is a reason mathematics uses one-letter names all over the place. :smile:

And how does the modified grammar fit onto a printed letter/A4 page?

Furthermore I am not completely sure which audience is targeted: Compiler/Haskell folks can grasp the abbreviated names quite easily, because the way they are abbreviated is common. Newcomers OTOH probably won't understand the meaning of a qualified-constructor-symbol more easily than a qconsym.

I'm all for better cross-referencing, though.

goldfirere commented 5 years ago

I'm close to the fence on this one, but would probably lean toward keeping the short names we have now. That might be only because I already know them, but I think @svenpanne's question about audience is apt.

Perhaps a fix that would work for everyone is simply to document the abbreviations, saying that q means qualified and tycon means type constructor, etc.

And yes to cross-referencing.

llelf commented 5 years ago

I also don’t see long names as more readable. And, as I mentioned on a mailing list, we have to think about pdf too.

sollyucko commented 5 years ago

I think leaving the abbreviations as-is but documenting them sounds reasonable. Adding tooltips would also be useful, but it might be difficult and time-consuming to implement. Same thing for links, although those would also need to have a canonical location to point to (perhaps section 10, Syntax Reference.