Recommendations for a first GHC API project

In general terms, I want to broaden my Haskell knowledge by learning the GHC API to better understand the compilation pipeline. Ultimately, I intend to contribute to projects like Liquid Haskell or HLS, and compile my own projects to WASM. This knowledge could be an asset for me to work on a GSoC proposal in case Haskell is selected this year.

The GHC API documentation is quite dense. I figured I could start by developing a simple application to get to grips with the basics, but don´t know what kind of application would be a good target. I’ll appreciate any ideas on a simple project I could accomplish by myself, and any up-to-date references that could be of help (blog posts or tutorials).

1 Like

I guess the answer ultimately depends on how much/which parts of the GHC API you want to work with. I have used it for developing a small HLS plugin, implementing a new “code action”, and I can recommend doing so. It is a project that is small enough to be manageable, but significant enough to be useful. How you will be using the API will depend on the needs of the plugin of course. In my case it was mostly fiddling with the AST, but you can pick a suitable plugin idea if you have some specific parts of the API you are interested in.

3 Likes