Humake is a tool for compiling Haskell programs. It allows
independent modules to be compiled in parallel, possibly on
different computers. It has a graphical user interface (see
Figure 92) where the progress of the compilation can be
monitored and information on individual modules can be
obtained. The module-dependency graph is automatically extracted
from the source code. The dependency graph, file-modification
dates and other module information is retained between
compilations and can be dynamically updated when a module is
changed, to minimise the work required to start a recompilation
and thus make the edit-compile-test development cycle faster.
Figure 92. The user interface of Humake.
In the current version, the user interface shows
- a module list where the status of each module is indicated by a
colored lamp. The color is green if the module is up-to-date,
yellow if it is being compiled or waiting to be compiled
(because it is out of date with respect to its source code or
the interface of an imported module),
red if compilation of the module failed and
blue if the module was taken from a pre-compiled library. A menu
allows you to choose from a number of different sorting
- a module information window, which shows imported
modules, modules that import this module, file location and
- an update button which makes Humake re-read the module
information after it has been changed. Humake can also receive
change notifications directly from a text editor. This has been
implemented for Emacs.
- a list showing which modules are currently being compiled and
how many modules are currently waiting to be compiled.
The structure of the implementation is sketched in
. Most of the work is handled by the fudget
. It traverses the modules to extract the
module-dependency graph and builds a representation of it. It
also maintains a data structure representing the status of the
compilation process. This structure is chosen so that when a
compilation completes, or a module is updated, a new compilation
can be started as quickly as possible.
The source is about 1200 lines long.
main = fudlogue $ shellF "Humake" humakeF
loopLeftF ((moduleInfoF>+<parallelCompileF) >==< dependencyF)
--- GUI fudgets:
statusDisplayF = ... --the bottom part of the window
moduleInfoF = ... -- the module list, module info and the update buttons
--- Non-GUI fudgets:
filterRightSP >^^=< (statusDisplayF>+<idF) >==<
loopThroughRightF (absF ctrlSP) (parServerF hosts compileF)
ctrlSP = ...
parServerF :: [id] -> (id->F req resp) -> F req resp
parServerF ids serverF = ... -- essentially as in Figure 88
compileF :: String -> F CompilerReq CompilerResp
compileF host = ... -- a compilation server
editorInterfaceF :: F a String
editorInterfaceF = ... -- outputs the name of a file when it is saved
Figure 93. Implementation of Humake.