Changes between Version 17 and Version 18 of Commentary/Pipeline


Ignore:
Timestamp:
Oct 4, 2006 8:51:23 PM (8 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Pipeline

    v17 v18  
    2727An '''interface file''' supports separate compilation by recording the information gained by compiling {{{M.hs}}} in its interface file {{{M.hi}}}.  Morally speaking, the interface file {{{M.hi}}} is part of the object file {{{M.o}}}; it's like a super symbol-table for {{{M.o}}}. 
    2828 
    29 Interface files are kept in binary, GHC-specific format.  The format of these files changes with each GHC release, but not with patch-level releases.  The format of an interface file can be determined by examining {{{compiler/iface/IfaceSyn}}} and {{{compiler/iface/IfaceType}}}.  An informal description of a particular file, suitable for a person (not for machine parsing), can be found thus: 
     29Interface files are kept in binary, GHC-specific format.  The format of these files changes with each GHC release, but not with patch-level releases.  The contents of the interface file is, however, completely independent of the back end you are using (`-fviaC`, `-fasm`, `-fcmm` etc). 
     30 
     31Although interface files are kept in binary format, you can print them in human-readable form using the command: 
    3032{{{ 
    3133  ghc --show-iface M.hi 
    3234}}} 
     35This textual format is not particularly designed for machine parsing.  Doing so might be possible, but if you want to read GHC interface files you are almost certainly better off using the [wiki:Commentary/Compiler/API GHC API] to do so. 
    3336 
    3437Here are some of the things stored in an interface file {{{M.hi}}} 
     
    3841 * The strictness, arity, and unfolding of exported functions.  This is crucial for cross-module optimisation; but it is only included when you compile with {{{-O}}}. 
    3942 
     43The contents of an interface file is the result of serialising the '''{{{IfaceSyn}}}''' family of data types.  The data types are in [[GhcFile(compiler/iface/IfaceSyn)]] and [[GhcFile(compiler/iface/IfaceType)]]; the binary serialisation code is in [[GhcFile(compiler/iface/BinIface)]].