Coarse-grained recompilation checking
GHC's recompilation checker is very clever: it tracks changes at the level of an individual function or type, and only recompiles a module when the entities it actually depends on have changed.
However, there are some drawbacks to doing this:
- It is complicated and hard to get right
- It adds extra information to .hi files
- It takes time to check the dependencies (probably not much, though)
Furthermore,
-
we have virtually no tests for it
-
when it goes wrong, the bug is very hard to reproduce, which means that
failures are often not reported.
So we propose:
-
Simplify the recompilation checker so that it tracks changes at the level of a
module only. This will cause more recompilation, but it will be much easier
to get right and to test.
-
As an intermediate step, we could implement both schemes and generate some output
to indicate when they give different results.
See Commentary/Compiler/RecompilationAvoidance for more discussion.