Opened 7 months ago

Last modified 7 weeks 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.10.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:


This is related to a relatively old issue, that the bytecode interpreter cannot handle UnboxedTuples: . 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 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 and . 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 (2)

comment:1 Changed 6 months ago by bgamari


These won't be fixed for in GHC 8.6.

comment:2 Changed 7 weeks ago by osa1


Bumping milestones of low-priority tickets.

Note: See TracTickets for help on using tickets.