skip to main content
research-article

A fresh look at programming with names and binders

Published:27 September 2010Publication History
Skip Abstract Section

Abstract

A wide range of computer programs, including compilers and theorem provers, manipulate data structures that involve names and binding. However, the design of programming idioms which allow performing these manipulations in a safe and natural style has, to a large extent, remained elusive.

In this paper, we present a novel approach to the problem. Our proposal can be viewed either as a programming language design or as a library: in fact, it is currently implemented within Agda. It provides a safe and expressive means of programming with names and binders. It is abstract enough to support multiple concrete implementations: we present one in nominal style and one in de Bruijn style. We use logical relations to prove that "well-typed programs do not mix names with different scope". We exhibit an adequate encoding of Pitts-style nominal terms into our system.

Skip Supplemental Material Section

Supplemental Material

icfp-tues-1545-pouillard.mov

References

  1. }}Thorsten Altenkirch and Bernhard Reus. Monadic presentations of lambda terms using generalized inductive types. In Computer Science Logic, volume 1683 of Lecture Notes in Computer Science, pages 453--468. Springer, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}Robert Atkey. Syntax for free: representing syntax with binding using parametricity. In International Conference on Typed Lambda Calculi and Applications (TLCA), volume 5608 of Lecture Notes in Computer Science, pages 35--49. Springer, July 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}Robert Atkey, Sam Lindley, and Jeremy Yallop. Unembedding domain-specific languages. In Haskell symposium, pages 37--48, September 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}Brian E. Aydemir, Aaron Bohannon, Matthew Fairbairn, J. Nathan Foster, Benjamin~C. Pierce, Peter Sewell, Dimitrios Vytiniotis, Geoffrey Washburn, Stephanie Weirich, and Steve Zdancewic. Mechanized metatheory for the masses: The \textscPoplMark challenge. In International Conference on Theorem Proving in Higher Order Logics (TPHOLs), Lecture Notes in Computer Science. Springer, August 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}Richard Bird and Ross Paterson. de Bruijn notation as a nested datatype. Journal of Functional Programming, 9(1):77--91, January 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}Chiyan Chen and Hongwei Xi. Implementing typeful program transformations. In ACM Workshop on Evaluation and Semantics-Based Program Manipulation (PEPM), pages 20--28, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. }}Adam Chlipala. A certified type-preserving compiler from lambda calculus to assembly language. In ACM Conference on Programming Language Design and Implementation (PLDI), pages 54--65, June 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. }}Kevin Donnelly and Hongwei Xi. Combining higher-order abstract syntax with first-order abstract syntax in ATS. In ACM Workshop on Mechanized Reasoning about Languages with Variable Binding, pages 58--63, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}Louis-Julien Guillemette and Stefan Monnier. A type-preserving compiler in Haskell. In ACM International Conference on Functional Programming (ICFP), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}Daniel R. Licata and Robert Harper. A universe of binding and computation. In ACM International Conference on Functional Programming (ICFP), pages 123--134, September 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}Conor McBride and Ross Paterson. Applicative programming with effects. Journal of Functional Programming, 18(1):1--13, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}Brigitte Pientka. A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions. In ACM Symposium on Principles of Programming Languages (POPL), pages 371--382, January 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}Andrew M. Pitts. Parametric polymorphism and operational equivalence. Mathematical Structures in Computer Science, 10:321--359, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}Andrew M. Pitts. Alpha-structural recursion and induction. Journal of the ACM, 53:459--506, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}Andrew M. Pitts. Nominal System T. In ACM Symposium on Principles of Programming Languages (POPL), pages 159--170, January 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}Adam Poswolsky and Carsten Schurmann. Practical programming with higher-order encodings and dependent types. In European Symposium on Programming (ESOP), volume 4960 of Lecture Notes in Computer Science, pages 93--107. Springer, March 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. }}Adam Poswolsky and Carsten Schurmann. System description: Delphin - A functional programming language for deductive systems. Electronic Notes in Theoretical Computer Science, 228:113--120, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}François Pottier. Static name control for FreshML. In IEEE Symposium on Logic in Computer Science (LICS), pages 356--365, July 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. }}Nicolas Pouillard and François Pottier. A fresh look at programming with names and binders (Agda code), March 2010. http://tiny.nicolaspouillard.fr/FreshLookAgda. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. }}Nicolas Pouillard and François Pottier. A fresh look at programming with names and binders (extended version). http://tiny.nicolaspouillard.fr/FreshLookExt, March 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}Carsten Schüurmann, Adam Poswolsky, and Jeffrey Sarnat. The ∇-calculus: Functional programming with higher-order encodings. In International Conference on Typed Lambda Calculi and Applications (TLCA), volume 3461 of Lecture Notes in Computer Science, pages 339--353. Springer, April 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}Mark R. Shinwell, Andrew M. Pitts, and Murdoch J. Gabbay. FreshML: Programming with binders made simple. In ACM International Conference on Functional Programming (ICFP), pages 263--274, August 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A fresh look at programming with names and binders

      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 45, Issue 9
        ICFP '10
        September 2010
        382 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1932681
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '10: Proceedings of the 15th ACM SIGPLAN international conference on Functional programming
          September 2010
          398 pages
          ISBN:9781605587943
          DOI:10.1145/1863543

        Copyright © 2010 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 27 September 2010

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      ePub

      View this article in ePub.

      View ePub
      About Cookies On This Site

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

      Learn more

      Got it!