skip to main content
10.1145/2500365.2500614acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Using circular programs for higher-order syntax: functional pearl

Published: 25 September 2013 Publication History

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

Cited By

View all

Index Terms

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

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    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
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 25 September 2013

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. circular programming
    2. embedded languages
    3. higher-order syntax

    Qualifiers

    • Research-article

    Conference

    ICFP'13
    Sponsor:
    ICFP'13: ACM SIGPLAN International Conference on Functional Programming
    September 25 - 27, 2013
    Massachusetts, Boston, USA

    Acceptance Rates

    ICFP '13 Paper Acceptance Rate 40 of 133 submissions, 30%;
    Overall Acceptance Rate 333 of 1,064 submissions, 31%

    Upcoming Conference

    ICFP '25
    ACM SIGPLAN International Conference on Functional Programming
    October 12 - 18, 2025
    Singapore , Singapore

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)5
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 05 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media