Module output directories for extensible interfaces
Various tickets suggest that we write extra data alongside traditional interface data:
#17843 proposes an early typechecking (
.hi-tc) variant of
.hi files being written instead of multiple versions of
https://gitlab.haskell.org/ghc/ghc/wikis/Core-interface-section proposes extending interface files with optional core data for use by plugins and the like.
.hi files with module output data directories (e.g.
.hm), and use multiple files within these to represent component of output. With this in mind, an example module directory might look like:
Example.hm: |- symbol-table |- dictionary |- ghc: |- core |- interface |- hie
- External tools can treat the
.hmdirectory as relatively opaque for the purpose of moving around outputs, etc. without knowing about any additional data.
- Outputs can be written at any phase of the compilation process, making this a potential method for storing resumable compilation data.
- Subdirectories allow a natural namespacing structure for external tools operating on modules.
- In current the
Namesymbol table and
FastStringdictionary is written at the end of the file. Since it's likely that these extra files will overlap in their symbol tables/dictionaries, it might be useful to share a single one of each within the module output directory.
- Additional lookup tables for more types than