[GHC] #10316: Move Typeable type-rep generation from use site to definition site

#10316: Move Typeable type-rep generation from use site to definition site -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- This ticket is a continuation of #9858. The interim solution for 7.10 was to generate `Typeable` data structures on the fly, as needed in client modules. This ticket is about moving the generation of the runtime representation of type constructors to their definition sites. (#9858 already has too much going on in it, so I started a fresh ticket for this refactoring.) The branch is `wip/T9858-typeable-spj`. In favour of (A) code at use site (as in 7.10): * Pay as you go. No code at all is generated unless you use `Typeable` In favour of (B) code at definition site: * More sharing. We make a `TyCon` (see `Data.Typeable.Internal`) for `T` (say) just once, in the module that defines `T`. * We may ultimately want the `TyCon` for `T` to include its source location, and perhaps more besides. If it is defined in `T` it becomes easier to do that. General observation: (B) is like `Typeable` was before, when it was an ordinary class. The difference now is that all types are `Typeable`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10316 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10316: Move Typeable type-rep generation from use site to definition site -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:757 -------------------------------------+------------------------------------- Changes (by simonpj): * differential: => Phab:757 Comment: I tried to reduce the per-tycon overheads as far as possible. For a data type {{{ data Foo = Foo1 | Foo2 }}} in module `M`, you get {{{ $moduleM :: Module $moduleM = Module "mypackage-2.3"# "M"# $tcFoo :: TyCon $tcFoo = TyCon xxx yyy "Foo"# $moduleM $tcFoo1 :: TyCon $tcFoo1 = TyCon xxx yyy "Foo1"# $moduleM ..similarly Foo2... }}} That is, a sharted record for the module, plus a `TyCon` for each type constructor and data constructor. All C strings, all static data, no thunks, no code. At the moment these definitions are injected at the beginning of the optimisation pipeline, but since they are so static they could equally well go at the end, and that woudl save fruitless attempts to optimise them. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10316#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10316: Move Typeable type-rep generation from use site to definition site -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D757 -------------------------------------+------------------------------------- Changes (by goldfire): * differential: Phab:757 => Phab:D757 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10316#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10316: Move Typeable type-rep generation from use site to definition site -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: task | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D757 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * type: bug => task * resolution: => fixed Comment: This was merged quite some time ago (see #9858). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10316#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC