[GHC] #9601: Make the rewrite rule system more powerful

#9601: Make the rewrite rule system more powerful -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Project (more | Type of failure: than a week) | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- It would be amazing if the current RULES system could be upgraded to include various predicates, or even into a full-on strategic programming system. This would allow far far more optimisations to be possible, rather than the current conservative system where you have to make sure that the optimisations ALWAYS apply. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9601 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9601: Make the rewrite rule system more powerful -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): See also this email https://mail.haskell.org/pipermail/haskell- cafe/2008-January/038196.html (2008) and [wiki:ProjectSuggestions#TurningGHCintoaplatform]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9601#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9601: Make the rewrite rule system more powerful -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.0.1 => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9601#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9601: Make the rewrite rule system more powerful -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #9137, #10804 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by nomeata): * related: => #9137, #10804 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9601#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9601: Make the rewrite rule system more powerful -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #9137, #10804 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.1 => Comment: Removing milestone as this is more of a long-term goal. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9601#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9601: Make the rewrite rule system more powerful -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #9137, #10804 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): I don't know much about `RULES`, let me highlight this idea from ticket:9136#comment:1 (that lead to #9137): {{{ forall x y z. (IsLiteral y, IsLiteral z) => (x +# y) -# z = x +# (y -# z) forall x y z. (IsLiteral y, IsLiteral z) => (x -# y) -# z = x -# (y +# z) ... }}} This strikes my fancy! It's like a type class (predicate) for syntax * Could `IsLiteral` be given a kind? * Which constraint can be made available? (`IsEven`, `IsOdd`, ...) * Which properties can the compiler make use of? * Which properties can the optimizer make use of? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9601#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9601: Make the rewrite rule system more powerful -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #9137, #10804 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): The syntax might look like these are types, but morally, they are would simply be boolean predicates: {{{ IsLiteral :: a -> Bool }}} These predicates could be normal, user defined functions (which the compiler would then try to symbolically evaluate), built-in “magic” predicates like this one, or functions without “normal” implementation, but with further rewrite rules that determine the predicate. Isabelle’s simplifier supports all that, and even more, if you are looking for inspiration. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9601#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC