Abstract
This pearl presents a novel technique for constructing a first-order syntax tree directly from a higher-order interface. We exploit circular programming to generate names for new variables, resulting in a simple yet efficient method. Our motivating application is the design of embedded languages supporting variable binding, where it is convenient to use higher-order syntax when constructing programs, but first-order syntax when processing or transforming programs.
- E. Axelsson, K. Claessen, M. Sheeran, J. Svenningsson, D. Engdal, and A. Persson. The design and implementation of Feldspar. In Implementation and Application of Functional Languages, volume 6647 of LNCS, pages 121--136. Springer Berlin Heidelberg, 2011. Google Scholar
Digital Library
- R. Bird. Using circular programs to eliminate multiple traversals of data. Acta Informatica, 21(3):239--250, 1984.Google Scholar
Digital Library
- P. Bjesse, K. Claessen, M. Sheeran, and S. Singh. Lava: hardware design in Haskell. In Proceedings of the third ACM SIGPLAN international conference on Functional programming, ICFP '98, pages 174--184. ACM, 1998. Google Scholar
Digital Library
- V. Capretta and A. P. Felty. Combining de Bruijn indices and higher-order abstract syntax in Coq. In Types for Proofs and Programs, volume 4502 of Lecture Notes in Computer Science, pages 63--77. Springer Berlin Heidelberg, 2007. Google Scholar
Digital Library
- K. Claessen and D. Sands. Observable sharing for functional circuit description. In Advances in Computing Science, ASIAN'99, volume 1742 of LNCS, pages 62--73. Springer, 1999. Google Scholar
Digital Library
- C. Elliott, S. Finne, and O. De Moor. Compiling embedded languages. Journal of Functional Programming, 13(3):455--481, May 2003. Google Scholar
Digital Library
- A. Gill. Type-safe observable sharing in Haskell. In Proceedings of the 2nd ACM SIGPLAN symposium on Haskell, Haskell '09, pages 117--128. ACM, 2009. Google Scholar
Digital Library
- G. Mainland and G. Morrisett. Nikola: embedding compiled GPU functions in Haskell. In Proceedings of the third ACM Haskell symposium on Haskell, Haskell '10, pages 67--78. ACM, 2010. Google Scholar
Digital Library
- C. McBride. I am not a number, I am a classy hack. 2010. URL http://www.e-pig.org/epilogue/?p=773.Google Scholar
- T. L. McDonell, M. M. Chakravarty, G. Keller, and B. Lippmeier. Optimising purely functional GPU programs. Accepted for publication at ICFP 2013. Google Scholar
Digital Library
- F. Pfenning and C. Elliot. Higher-order abstract syntax. In Proceedings of the ACM SIGPLAN 1988 conference on Programming Language design and Implementation, PLDI '88, pages 199--208. ACM, 1988. Google Scholar
Digital Library
- J. Svensson, M. Sheeran, and K. Claessen. Obsidian: A domain specific embedded language for parallel programming of graphics processors. In Implementation and Application of Functional Languages, volume 5836 of LNCS, pages 156--173. Springer Berlin Heidelberg, 2011. Google Scholar
Digital Library
Index Terms
Using circular programs for higher-order syntax: functional pearl
Recommendations
Using circular programs for higher-order syntax: functional pearl
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingThis pearl presents a novel technique for constructing a first-order syntax tree directly from a higher-order interface. We exploit circular programming to generate names for new variables, resulting in a simple yet efficient method. Our motivating ...
Tools and libraries to model and manipulate circular programs
PEPM '07: Proceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulationThis paper presents techniques to model circular lazy programs in a strict, purely functional setting. Circular lazy programs model any algorithm based on multiple traversals over a recursive data structure as a single traversal function. Such elegant ...
Higher-order abstract syntax in classical higher-order logic
LFMTP '09: Proceedings of the Fourth International Workshop on Logical Frameworks and Meta-Languages: Theory and PracticeHigher-Order Abstract Syntax, or HOAS, is a technique for using a higher-order logic as a metalanguage for an object language with binding operators. It avoids formalizing syntactic details related to variable binding. This paper gives an extension to ...







Comments