GHCi recompilation avoidance UI
Simon Peyton Jones
simonpj at microsoft.com
Wed Nov 1 08:46:20 UTC 2017
* What causes the undesired behaviour in GHC 8.2.1?
Is it this?
- GHCi wants to load module B with flags F
- There is a B.o but the flags differ
- So GHCi recompiles B to bytecode
* How does (1) help?
* Does (2) propose a new command (:load *M vs :load M)?
If so, how does it help.
* Is (3), what is the spec of the proposed new flags?
Is it this?
- GHC wants to compile module B with flags F
- There is a B.o compiled with flags F'
- And B.hs (and its dependencies) have not changed
- Then normally we'd recompile F unless F = F'
- But with -fignore-optim-changes we would weaken that equality to
ignore differences between F and F' that only affected optimisation
level (the list of such flags would need to be written out)
- And similarly for -fignore-hpc-changes
Precision is all!
| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of David
| Sent: 31 October 2017 15:42
| To: ghc-devs at haskell.org
| Subject: GHCi recompilation avoidance UI
| Changes in GHC 8.2.1 lead to a lot of recompilation, because GHCi now
| refuses to load optimized code unless -fobject-code (and optimization
| flags) are enabled. I propose the following slight modification to
| 1. Optimization flags (except -O0) imply -fobject-code. This ensures
| that GHC respects optimization flags regardless of --interactive.
| 2. Even when -fobject-code is on, :load *M will load M as bytecode.
| This provides the "escape hatch" from -fobject-code that you need to
| use debugging features, etc.
| 3. New -fignore-optim-changes and -fignore-hpc-changes (Phab:D4123)
| flags should enable users to put together object code and bytecode with
| diverse optimization levels/options and HPC options while still
| updating automatically based on source changes and whether profiling is
| Does this seem like a reasonable way forward?
| David Feuer
| ghc-devs mailing list
| ghc-devs at haskell.org
More information about the ghc-devs