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

GHC ghc-devs at haskell.org
Wed Oct 21 18:37:24 UTC 2015


#10871: Implement "fat" interface files which can be directly compiled without
source
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:  ezyang
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.11
      Resolution:                    |             Keywords:  backpack
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by ezyang):

 > In my (perhaps naive) view of the way this works, "instantiating a unit"
 is just compiling modules in dependency order, exactly as GHC does today.

 No, more has to be done.  For example, imagine package foo and bar set up
 this way:

 {{{
 -- package foo
 unit foo where
   signature H
   module P
 }}}

 {{{
 -- package bar
 unit a-impl where
   module A

 unit bar where
   include p
   include a-impl (A as H)
 }}}

 At the end of the day, we need to compile an instance of foo compiled
 against h-impl, e.g. `foo(H -> h-impl:A)`. How do we know that this is the
 case? Backpack specifies an ALGORITHM for figuring it out, which involves
 taking package `bar`, and then doing analysis on the includes (renames and
 all) to figure out what units are providing modules that other units
 require. If you support cross-package mutual recursion, this algorithm can
 be quite tricky indeed, since you need the business with infinite regular
 trees. So it seems quite desirable for this logic to live in GHC.

 So no, Cabal cannot just figure out how to instantiate units by looking at
 the package database, without also implementing a key part of the Backpack
 algorithms. (In the old design, Cabal DID implement this algorithm, but we
 really want to get away from that.)

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


More information about the ghc-tickets mailing list