Communicate to user why a module is being compiled to object code when being loaded into GHCi
When loading modules into GHCi, the
UnboxedTuples extension (!554 (merged)) can cause many modules to be compiled using object code. Currently, there is no explanation in GHC's console output for why this is happening, and there is no way to ask for an explanation.
One of the motivating usecases for !554 (merged) is to properly load GHC's code into the interpreter, as quickly as possible. The only way for me to practically reduce the number of modules built with object code was to add some debug traces which indicated which imports were causing modules to be built using object code.
Before !554 (merged) there was another case where object code compilation is enabled automatically for a subset of modules - see #8025 (closed) . When -fno-code is used, dependencies of modules using TemplateHaskell still get built, so that the compiletime code can be executed.
I propose two things:
The line of load progress output which indicates compilation to object code should indicate if it's happening due to use of
A ddump flag which outputs the import edges in module DAG which cause compilation to object code. Ideally this might even output in graphviz format, though it would be good to avoid having an edge for every single import. Haven't yet considered how to achieve that.