[GHC] #15454: Have GHCi automatically use -fobject-code for modules that use UnboxedTuples

GHC ghc-devs at haskell.org
Sat Jul 28 21:05:23 UTC 2018


#15454: Have GHCi automatically use -fobject-code for modules that use
UnboxedTuples
-------------------------------------+-------------------------------------
           Reporter:  mgsloan        |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.4.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This is related to a relatively old issue, that the bytecode interpreter
 cannot handle UnboxedTuples: https://ghc.haskell.org/trac/ghc/ticket/1257
 .  Rather than fix that issue, which sounds quite challenging, how about
 adding some automagic to GHCi which builds object code for modules that
 use UnboxedTuples?

 This is a bit trickier than just compiling those modules to object code,
 because object code cannot be linked against byte code (see
 https://ghc.haskell.org/trac/ghc/ticket/10965).  A potential solution to
 this is to also build all of the dependencies of modules that use
 UnboxedTuples using object code.

 This idea has some precedent, though as an external script - see
 https://ghc.haskell.org/trac/ghc/ticket/13101 and
 https://gist.github.com/bgamari/bd53e4fd6f3323599387ffc7b11d1a1e .  I
 think it would be best to put the solution to this directly in GHCi.  What
 do you think?  If y'all think it is a good idea, then I can volunteer to
 try to make it happen.

 As described in that ticket, this would be particularly helpful for
 loading GHC into GHCi, because GHC's code uses UnboxedTuples.  Currently,
 `-fobject-code` must be used, which means that the speedup from using GHCi
 isn't quite as much as it could be.  It is possible to get around this by
 first loading it with object code and then doing another load without
 object code, but that's rather inconvenient.

 Since this may be a surprising behavior change (the user may not have
 specified -odir and -hidir), it could possibly be enabled via a flag.

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


More information about the ghc-tickets mailing list