Introduce ghc --run mode
Recently in #ghc
we were discussing various overheads in typical Cabal builds. In particular, we currently spend quite a long time configuring packages with custom setup scripts due to the need to compile and (especially) link Setup.hs
. Given that this executable will be called only a handful of times and does very little interesting computation, this cost doesn't seem worthwhile. Rather, we would be better off using the bytecode interpreter.
While runghc
exists for this reason, the Cabal folks are concerned about the complexity in locating the executable. It would be nice if GHC had a --run
mode that exposed the same functionality. In this case runghc
could become a wrapper around the GHC executables own --run
mode, just like the ghci
executable wraps ghc --interactive
today.