Affiliation:
1. University of Kansas, Lawrence, KS, USA
Abstract
The importance of reasoning about and refactoring programs is a central tenet of functional programming. Yet our compilers and development toolchains only provide rudimentary support for these tasks. This paper introduces a programmatic and compiler-centric interface that facilitates refactoring and equational reasoning. To develop our ideas, we have implemented HERMIT, a toolkit enabling informal but systematic transformation of Haskell programs from
inside
the Glasgow Haskell Compiler's optimization pipeline. With HERMIT, users can experiment with optimizations and equational reasoning, while the tedious heavy lifting of performing the actual transformations is done for them.
HERMIT provides a transformation API that can be used to build higher-level rewrite tools. One use-case is prototyping new optimizations as clients of this API before being committed to the GHC toolchain. We describe a HERMIT application - a read-eval-print shell for performing transformations using HERMIT. We also demonstrate using this shell to prototype an optimization on a specific example, and report our initial experiences and remaining challenges.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
17 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Improving Haskell;Lecture Notes in Computer Science;2019
2. Staged generic programming;Proceedings of the ACM on Programming Languages;2017-08-29
3. Compiling to categories;Proceedings of the ACM on Programming Languages;2017-08-29
4. Stream fusion, to completeness;ACM SIGPLAN Notices;2017-05-11
5. Staging generic programming;Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation;2016-01-11