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

GHC ghc-devs at haskell.org
Sat Sep 19 04:48:57 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 Revisions:
-------------------------------------+-------------------------------------

Comment (by ezyang):

 Here is a comment about the extra things that we seem to need to serialize
 to a `ModIface`, beyond `IfaceBinding`s:

 1. `mg_rdr_env :: GlobalRdrEnv`. Originally, I claimed that this was only
 used by the vectorizor; however, I was slightly mistaken: it is ALSO used
 to generate error messages / debug information in the simplifier and
 interface generation code. For example, we don't warn about orphans until
 `MkIface`; and to give nice qualified names, we need a `GlobalRdrEnv`. I'm
 investigating if we can move orphan warnings earlier, but in general to
 not serialize `GlobalRdrEnv` we will pay a little bit in how good the
 error messages are (maybe this is OK for the simplifier monad, which I
 don't believe gives any user-visible messages using this).

 2. `mg_hpc_info :: HpcInfo` and `mg_foreign :: ForeignStubs` are directly
 passed through to code generation during Tidy, so we can't get rid of
 them. So my inclination is to create a field in `ModIface` like
 `mi_cg_info :: Maybe CgIface`, which contains just these two bits.

 I managed to eliminate the usage fields in `ModGuts` by computing usage
 information earlier, during desugaring. This seems to work quite well.

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


More information about the ghc-tickets mailing list