[jhc] feature requests for franchise's benefit

David Roundy roundyd at physics.oregonstate.edu
Wed Sep 2 10:47:56 EDT 2009


I've been looking into how to teach franchise to compile using jhc,
and there are a few features that would make this much easier.

The first is that I'd like a way to ask jhc what files a given compile
will depend on.  Something like gcc -M, although I don't care to have
make syntax in the output.  I don't really care about the format of
the output, so long as it's easy to extract a list of files from it.
Ideally, this would output *all* dependencies, including installed .hl
files.  I'm imagining this is the sort of output that could
(hypothetically) be extracted from strace run on a successful compile.

Incidentally, I'm thinking of enfranchise the libraries that come with
jhc, which would allow them to be rebuilt automatically when the
source is changed, rather than the current scheme of "rm *.hl; make
libs".

The above won't be so helpful for unsuccessful compiles, as will
happen if certain modules are missing (e.g. they need to be generated
from a .hsc file), so a second feature request would be to have a way
of finding out from jhc what modules it can't find.  These modules
might either be generated files (e.g. from a .hs.in file or a .hsc
file, or a user-written rule), or they might be defined in a package
that needs to be included.  For ghc, I get this information by parsing
its error messages.  It's not a very good solution, but works.  I'd
like a better solution with jhc, perhaps a flag to specify a file to
output missing modules to?

And finally, a nice way to find out which modules are exported by
which packages.  Perhaps something as simple as a --show-exports flag:

jhc --no-auto -pbase-1.0 --show-exports

Another interesting option for this feature would be to allow
--show-ho to accept a package name such as base-1.0 and look up its
.hl file using the same path that -p would.  Then if the output of
--show-ho were stable (and parsable), that would be sufficient.
-- 
David Roundy


More information about the jhc mailing list