Partial evaluation and automatic program generation
Partial evaluation and automatic program generation
Dictionary-free overloading by partial evaluation
Lisp and Symbolic Computation - Special issue on partial evaluation and semantics-based program manipulation (PEPM '94)
Scrap your boilerplate: a practical design pattern for generic programming
Proceedings of the 2003 ACM SIGPLAN international workshop on Types in languages design and implementation
A supercompiler system based on the language REFAL
ACM SIGPLAN Notices
Secrets of the Glasgow Haskell Compiler inliner
Journal of Functional Programming
Scrap more boilerplate: reflection, zips, and generalised casts
Proceedings of the ninth ACM SIGPLAN international conference on Functional programming
Call-pattern specialisation for Haskell programs
ICFP '07 Proceedings of the 12th ACM SIGPLAN international conference on Functional programming
Uniform boilerplate and list processing
Haskell '07 Proceedings of the ACM SIGPLAN workshop on Haskell workshop
A Haskell Hosted DSL for Writing Transformation Systems
DSL '09 Proceedings of the IFIP TC 2 Working Conference on Domain-Specific Languages
Alloy: fast generic transformations for Haskell
Proceedings of the 2nd ACM SIGPLAN symposium on Haskell
Proceedings of the 2010 ACM SIGPLAN workshop on Partial evaluation and program manipulation
Supercompilation by evaluation
Proceedings of the third ACM Haskell symposium on Haskell
Taming code explosion in supercompilation
Proceedings of the 20th ACM SIGPLAN workshop on Partial evaluation and program manipulation
The HERMIT in the machine: a plugin for the interactive transformation of GHC core language programs
Proceedings of the 2012 Haskell Symposium
Template your boilerplate: using template haskell for efficient generic programming
Proceedings of the 2012 Haskell Symposium
Equality proofs and deferred type errors: a compiler pearl
Proceedings of the 17th ACM SIGPLAN international conference on Functional programming
Hi-index | 0.00 |
The most widely used generic-programming system in the Haskell community, Scrap Your Boilerplate (SYB), also happens to be one of the slowest. Generic traversals in SYB are often an order of magnitude slower than equivalent handwritten, non-generic traversals. Thus while SYB allows the concise expression of many traversals, its use incurs a significant runtime cost. Existing techniques for optimizing other generic-programming systems are not able to eliminate this overhead. This paper presents an optimization that completely eliminates this cost. Essentially, it is a partial evaluation that takes advantage of domain-specific knowledge about the structure of SYB. It optimizes SYB-style traversals to be as fast as handwritten, non-generic code, and benchmarks show that this optimization improves the speed of SYB-style code by an order of magnitude or more.