[GHC] #10871: Implement "buildable" interface files which can be directly compiled without source

GHC ghc-devs at haskell.org
Sat Sep 12 01:52:58 UTC 2015


#10871: Implement "buildable" interface files which can be directly compiled
without source
-------------------------------------+-------------------------------------
              Reporter:  ezyang      |             Owner:  ezyang
                  Type:  feature     |            Status:  new
  request                            |
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.11
              Keywords:  backpack    |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
 A fat interface file is like a normal hi file, but with extra information
 so that GHC can *recompile* the associated module without having to parse,
 rename and typecheck the source code again. The proposed command-line
 interface is something like (subject to bikeshedding):

 {{{
 ghc -c A.hs -fno-code -fwrite-buildable-interface
 # produces a .hi-build file, then
 ghc -c A.hi-build
 # completes building, as if ghc -c A.hs had been called
 }}}

 The primary motivation for this is to support partially compiling
 indefinite packages, which cannot be compiled to object code due to the
 fact that some of the dependencies haven't been provided yet. However,
 there are some other cases where this might be useful:

 1. Supercompilation requires having the source of all bindings, buildable
 interfaces can make this information available, even beyond what storing
 inlinings might provide
 2. A buildable interface file can be used to build variants of a source,
 e.g. profiling and optimization, even "on the fly" by GHC if necessary.

 And maybe more we haven't thought of yet.

 The primary function you need to implement is a function from
 `ModIface`/`ModDetails` to `TcGblEnv`, which can then be fed to the
 desugarer. I'm looking at what things we need to add to `ModIface` to
 support this.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10871>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list