Skip to content

Drop dependency on ghc-source-gen #512

@TeofilC

Description

@TeofilC

ghc-source-gen is tightly coupled to the GHC AST. This is an inherently unstable interface that can and does change with each version of GHC.

This makes GHC upgrades difficult for a project that depends on proto-lens and therefore ghc-source-gen, since each release requires a lot of CPP to be added.

I'm wondering if it would be possible to move away from using ghc-source-gen. I think the safety gains from using the actual AST are quite low, while the costs from coupling are quite high. A lot of the complexity comes from exactprint annotation which don't seem to be used by this library at all.

I think using a pretty printing library to generate Haskell ASTs would be much easier to maintain. Note that the unlike the AST, the textual surface syntax is a stable interface. Alternatively we could use the template-haskell AST.

I would be happy to put some time into implementing this if this seems like a good idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions