Opened 5 months ago

Last modified 4 months ago

#15454 new feature request

Have GHCi automatically use -fobject-code for modules that use UnboxedTuples

Reported by: mgsloan Owned by:
Priority: normal Milestone: 8.8.1
Component: Compiler Version: 8.4.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

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.

Change History (1)

comment:1 Changed 4 months ago by bgamari

Milestone: 8.6.18.8.1

These won't be fixed for in GHC 8.6.

Note: See TracTickets for help on using tickets.