[project @ 1996-07-25 20:43:49 by partain]
[ghc-hetmet.git] / ghc / docs / users_guide / recomp.lit
1 %************************************************************************
2 %*                                                                      *
3 \section[recomp]{The GHC recompilation checker (and using `make')}
4 \index{recompilation checker}
5 \index{make and recompilation}
6 %*                                                                      *
7 %************************************************************************
8
9 The Haskell~1.3 module system (nicely improved, thank you very much)
10 requires a substantially different implementation, which we have done
11 for GHC~2.01.
12
13 We have taken a fairly radical approach and implemented a ``go to the
14 horse's mouth'' scheme; that is, when seeking out information about an
15 entity \tr{Foo.bar}, GHC will always look in the interface for
16 \tr{Foo}---no matter what interface {\em told us} about \tr{Foo.bar}
17 (via re-exporting and whatnot).
18
19 This ``horse's mouth'' scheme removes some of the most unsavoury
20 aspects of GHC~0.2x's behaviour (because of picking up duff
21 information about re-exported entities).  However, the keen-minded
22 user will see that it makes it difficult to maintain
23 \tr{make}-friendly dependencies between modules.
24
25 Enter the ``recompilation checker'', which you invoke merely by adding
26 a \tr{-recomp} option\index{-recomp option} to your GHC command line.
27 (You should also create ordinary `make' dependencies; there's an
28 example of how to do this in \sectionref{mkdependHS}.)
29
30 GHC will now start ``compiling'' much more often than in the old days,
31 but it will frequently bail out quickly, saying the recompile is
32 \tr{NOT NEEDED}.  What a beautiful sight!
33
34 The recompilation checker is not finished.  Its main faults are:
35 (a)~it doesn't yet do the right things for instance declarations;
36 (b)~it doesn't do anything about pragmas (happily, GHC~2.01 doesn't
37 produce any); (c)~it has no good solution for mutually-recursive
38 modules.
39
40 Patrick Sansom has a workshop paper about how all these things should
41 be done.  Ask him (email: \tr{sansom}) if you want a copy.