BNFC / bnfc

BNF Converter
http://bnfc.digitalgrammars.com/
582 stars 161 forks source link

GADT versus other Haskell options #396

Open ScottFreeCode opened 2 years ago

ScottFreeCode commented 2 years ago

The GADT version of the Haskell backend does not appear to respect --text-token or --functor; I don't know GADTs well enough to know if the functor representation is possible (though it probably ought to warn it's ignoring the option, if it isn't possible), but the text option(s) should presumably be fixed if nothing else. If GADTs and Functors don't mix it would be nice to find an alternative means of getting position info in the GADT implementation as well.

(Personally I have, so far, gotten away with using the non-GADT Haskell backend. I'm exploring what difference it makes though.)

andreasabel commented 2 years ago

The Haskell/GADT backend was implemented as a completely separate backend (likely starting with a clone of the Haskell backend). This was before my time as BNFC maintainer, and I do not understand the reasons why.
It could make sense to merge the Haskell and the Haskell/GADT backends so that they can again develop in lock-step, supporting the same options.
Personally, I have not used Haskell/GADT in my projects, but I know that @aarneranta does so and wants to keep it. There is also development of BNFC 3 going on at the moment (not public yet); when porting backends to BNFC 3, there should and will be de-cloning whenever it makes sense.