[GHC] #15617: Unboxed tuples/sum error message on `a = show 5` in expression evaluation and interactive modes

GHC ghc-devs at haskell.org
Mon Sep 24 03:40:27 UTC 2018


#15617: Unboxed tuples/sum error message on `a = show 5` in expression evaluation
and interactive modes
-------------------------------------+-------------------------------------
        Reporter:  ChaiTRex          |                Owner:
                                     |  JulianLeviston
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.6.1-beta1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by JulianLeviston):

 I've been still looking at this, just to keep this updated.

 > As you say, HscInterpreted means modules are compiled to bytecode and
 then interpreted. Interpreter can interact with native code and with
 -fobject-code you tell GHCi to compile the loaded modules to native code
 rather than to bytecode (the default, or -fbyte-code).

 The above paragraph confused me.

 The `-e` and `--interactive` flags setup `HscInterpreted` as the language
 in `main'` in `Main.hs`. DynFlags can be used to override this target (ie
 with `-fbytecode` or `-fobjectcode`). It seems like a mistake to be able
 to override it when it's already set to the `HscInterpreted` target,
 though I don't really understand if that's actually wanted.

 Like, in the case that you're using `ghci`, would you ever want to turn on
 `-fobjectcode` from within the interpreter? What would that mean if you
 could do that? Would it start compiling to object code and ''then''
 execute the compiled code?  If you're compiling with `ghc --make` and you
 also use `-fbytecode` is that something that's intended?

 I guess I'm trying to figure out if, when `-e` and `--interactive` set the
 `HscInterpreted` target it actually makes more sense to have that be a
 mode of the compiler that cannot be adjusted via `DynFlags` rather than
 the target which '''can''' be adjusted.

 However, I don't know the intent well enough. I'm not sure it's captured
 anywhere? The `man` doc for `ghc` seems to be extremely brief on what
 these particular flags mean, or are intended for.

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


More information about the ghc-tickets mailing list