On parsing Haskell and CPP

Gershom B gershomb at gmail.com
Sun Nov 22 20:53:20 UTC 2015

We've had quite a bit of discussion lately on the difficulty in
performing automated processing of Haskell files in the presence of

It turns out that folks have tackled this sort of problem in the world
of C, and done some interesting work.

I recently ran across SuperC [1], part of the xtc [2] project. In the
setting of C they have achieved some impressive results, including as
I understand it, the ability to handle the entire Linux kernel across
all CPP-recognized configurations.

They note that this is a rather tedious to implement task, even once
one has recognized the specification of how to do so. However, the
paper is good at reviewing related work and simpler techniques as
well, and perhaps among them there is a "good enough" set for the CPP
used in common Haskell libraries?


[1] https://cs.nyu.edu/rgrimm/papers/pldi12.pdf
[2] http://cs.nyu.edu/xtc/

More information about the ghc-devs mailing list