GHC.Paths

Simon Marlow marlowsd at gmail.com
Mon Jun 23 07:24:17 EDT 2008


Claus Reinke wrote:

> Life for 2/3/4 would be easier if there was a GHC.Paths module
> to import, with the paths relevant for the host ghc. Having that
> module in a package ghc-paths, with fields describing the paths,
> would be a useful bonus for tools/scripting.

This is what you were asking for, I think:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ghc-paths-0.1.0.1

$ ghc -e "GHC.Paths.libdir"
"/home/simonmar/fp/lib/x86_64-unknown-linux/ghc-6.8.3"
$ ghc -e "GHC.Paths.ghc_pkg"
"/home/simonmar/fp/bin/x86_64-unknown-linux/ghc-pkg"

Now I realise there are various ways in which this could be improved, not 
least of which is that it could come with GHC rather than having to be 
installed separately.  But I put it up mainly for comments and to provoke 
discussion about whether this is really the way we want to do it.  As a 
nice side-effect it should be useful right now to people using the GHC API.

Cons that I can think of:

  - it needs to be configured/built/installed when GHC is installed, which
    is inconvenient (e.g. a Windows install just copies files, normally)

  - we can't use this for GHC itself, without dynamic linking

  - the implementation is hacky (but we could make it less hacky if it
    were part of the GHC install).

Pros:

  - with dynamic linking this would be very useful - it would enable
    portable binaries dynamically linked against the GHC API.

  - it's a convenient API

Cheers,
	Simon


More information about the Cvs-libraries mailing list