Source plugins are new in GHC 8.6 and provide a convenient mechanism for a user to inspect and modify the internal source code representation of a Haskell program. They are an extension to the existing plugins mechanism which adds passes which run after parsing, renaming and typechecking. This allows users to extend the compiler without having to modify GHC itself.
In this talk I will briefly explain the new extension points before demonstrating and explaining some different source plugins that I have experimented with. Some examples: a reimplementation of the
graphmod library which is used to visualise a module graph of a package; a plugin to find unused names in an executable and a plugin which fills in specific instances for the Lift type class. Others have also implemented plugins which explain assertion failures and one which implements idiom brackets.
Tooling implemented using source plugins is robust and versatile. Plugins are invoked by passing additional options to GHC and so if your tool is implemented as a plugin, anyone can use it whether they use nix, cabal, stack or GHC manually.
Source plugins were implemented by Boldizsár Németh but the idea was previously suggested by Edsko de Vries.
Sun 23 Sep
|10:20 - 10:45|
Simon Peyton JonesMicrosoft, UKFile Attached
|10:45 - 11:10|
Matthew PickeringUniversity of BristolMedia Attached
|11:10 - 11:35|
Ryan ScottIndiana University at Bloomington, USAFile Attached
|11:35 - 11:43|
Chris SmithGoogle, USA
|11:43 - 11:51|
|11:51 - 12:00|
Samuel GélineauSimSpaceMedia Attached