byte-code-and-object-code unnecessarily generate interface objects in interpreter mode
Summary
if GHCi is invoked with -fbyte-code-and-object-code only, this option does not have any effect from the user's perspective. Byte code objects are already generated as the necessary GHCi operation, but additional interface objects are generated and held in memory. This should be regarded as feature misalignment and we need to turn that operation off if GHC mode is the interpreter mode.
A repl session without -fbyte-code-and-object-code
heap profile:
detailed:
The same repl session with -fbyte-code-and-object-code
heap profile:
detailed:
Steps to reproduce
Take a big project for the build of which GHC memory footprint is large.
Open a GHCi repl session with and without -fbyte-code-and-object-code
and compare the memory usage.
Expected behavior
The flag which does not have any impact should not give different resource usage.
Environment
- GHC version used: 9.6.3
Optional:
- Operating System: macOS Sonoma 14.3
- System Architecture: Apple M1 Max