skip to main content
research-article

Using circular programs for higher-order syntax: functional pearl

Published:25 September 2013Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Bird. Using circular programs to eliminate multiple traversals of data. Acta Informatica, 21(3):239--250, 1984.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Elliott, S. Finne, and O. De Moor. Compiling embedded languages. Journal of Functional Programming, 13(3):455--481, May 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. McBride. I am not a number, I am a classy hack. 2010. URL http://www.e-pig.org/epilogue/?p=773.Google ScholarGoogle Scholar
  10. T. L. McDonell, M. M. Chakravarty, G. Keller, and B. Lippmeier. Optimising purely functional GPU programs. Accepted for publication at ICFP 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Using circular programs for higher-order syntax: functional pearl

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 48, Issue 9
      ICFP '13
      September 2013
      457 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2544174
      Issue’s Table of Contents
      • cover image ACM Conferences
        ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
        September 2013
        484 pages
        ISBN:9781450323260
        DOI:10.1145/2500365

      Copyright © 2013 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 25 September 2013

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!