[GHC] #13261: Consider moving Typeable evidence generation wholly back to solver

GHC ghc-devs at haskell.org
Fri Feb 10 06:17:06 UTC 2017


#13261: Consider moving Typeable evidence generation wholly back to solver
-------------------------------------+-------------------------------------
           Reporter:  bgamari        |             Owner:
               Type:  task           |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           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:
-------------------------------------+-------------------------------------
 Since 91c6b1f54aea658b0056caec45655475897f1972 we have generated a set of
 bindings with each datatype definition which the compiler will refer to
 when constructing `Typeable` evidence. As described in the commit message,
 this came with a rather significant performance penalty, especially given
 that it is paid regardless of whether the code being compiled uses
 `Typeable`.

 The type-indexed Typeable implementation (#11011) augments these bindings
 with additional information allowing the kind of a type of be
 reconstructing at runtime (#10343). Unfortunately, this further blows up
 the cost of associated with Typeable binding generation. Some of the
 testsuite regressions are hard to swallow to say the least.

 While I'm still working out what can be done to reduce this cost, I do
 wonder whether the generating these bindings at the time of type
 definition is so wise. Relatively few users make use of Typeable and the
 cost is not negligible. Moreover, generating bindings for families of
 tycons (e.g. unboxed sums, which have thousands of type constructors and
 promoted data constructors) all at once produces a truly massive amount of
 code (albeit it only has to be done once).

 On the other hand, I suppose if Richard's dependent types story comes to
 fruition then perhaps the weight imposed by generating Typeable bindings
 at type-definition time might pull its weight.

 Anyways, just idle reflections.

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


More information about the ghc-tickets mailing list