[GHC] #12517: Simplify runghc command line options

GHC ghc-devs at haskell.org
Mon Aug 22 08:56:33 UTC 2016


#12517: Simplify runghc command line options
-------------------------------------+-------------------------------------
           Reporter:  harendra       |             Owner:  harendra
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  None           |           Version:  8.0.1
           Keywords:  runghc         |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Currently there are three ways runghc can pass options to GHC:
 1. unrecognized options are automatically passed to GHC
 2. options after a `--` are passed to GHC
 3. `--ghc-args=<arg>` passes arg to GHC

 The command line is difficult to comprehend and non-intuitive with all
 these different ways to pass options to GHC. Other than having multiple
 ways to do the same thing there are other problems too. For example:
 1. The meaning of `--` is overloaded, the usual meaning is that everything
 after it is non option or opaque args. This is difficult to explain and
 creates confusion.
 2. To pass a filename starting with a dash we need something like `runghc
 -- -- -prog.hs`. Which is not a usual use case but it needs to be
 explained in the manual anyway.
 3. It first appears that options after `--` will be passed to GHC
 including those not starting with a `-` but that is not the case. For args
 not starting with a `-` we need to use `--ghc-arg=` so there is not much
 use of the `--` anyway other than increased confusion.

 I propose to do away with all other mechanisms other than the explicit
 `--ghc-arg=<arg>` method. This will make the documentation and
 understanding of the command straightforward and intuitive. Though the
 change will not be backward compatible. If backward compatibility is
 really needed we will have to use deprecation warnings for the unsupported
 methods and remove them from the official documentation  and wait for some
 time before we actually remove them.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12517>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list