Opened 5 years ago

Closed 4 years ago

#2859 closed bug (fixed)

Reduce coercion terms to normal form

Reported by: simonpj Owned by:
Priority: low Milestone: 7.0.1
Component: Compiler Version: 6.10.1
Keywords: Cc: batterseapower@…, chak@…, tom.schrijvers@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time performance bug Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Sometimes coercion terms in a Core program grow absurdly big, and can readily be simplified to be much more compact. Example:

Big coercion terms have no runtime impact, but they may make compilation slower.

I speculate that it should be possible to use transformations such as those Max suggests in his comment on #2440, as a confluent, terminating rewriting system that makes coercion terms smaller, or, better still, rewrites them to a normal form. Then we can use "smart constructors" for coercion terms, so that they are always kept in normal form.

Identity coercions occur a lot, but are not so easy to recognise. I've also wondered about having some special representation for the identity.

This ticket is to remind us to look for such a rewrite system. Max, perhaps?

Change History (5)

comment:1 Changed 4 years ago by guest

  • Cc tom.schrijvers@… added

comment:2 Changed 4 years ago by simonmar

  • Type of failure set to Compile-time performance bug

comment:3 Changed 4 years ago by igloo

  • Milestone changed from 6.12 branch to 6.12.3

comment:4 Changed 4 years ago by igloo

  • Milestone changed from 6.12.3 to 6.14.1
  • Priority changed from normal to low

comment:5 Changed 4 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed

I implemented a coercion optimiser, some time ago. Hurrah.

Note: See TracTickets for help on using tickets.