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

Hygienic resugaring of compositional desugaring

Published:29 August 2015Publication History

ABSTRACT

Syntactic sugar is widely used in language implementation. Its benefits are, however, offset by the comprehension problems it presents to programmers once their program has been transformed. In particular, after a transformed program has begun to evaluate (or otherwise be altered by a black-box process), it can become unrecognizable. We present a new approach to _resugaring_ programs, which is the act of reflecting evaluation steps in the core language in terms of the syntactic sugar that the programmer used. Relative to prior work, our approach has two important advances: it handles hygiene, and it allows almost arbitrary rewriting rules (as opposed to restricted patterns). We do this in the context of a DAG representation of programs, rather than more traditional trees.

References

  1. M. D. Adams. Towards the essence of hygiene. In Principles of Programming Languages, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. Chlipala. Parametric higher-order abstract syntax for mechanized semantics. In International Conference on Functional Programming, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Erdweg, T. van der Storm, and Y. Dai. Capture-avoiding and hygienic program transformations. In European Conference on Object-Oriented Programming, 2014.Google ScholarGoogle Scholar
  4. M. Felleisen and R. Hieb. The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science, 103(2): 235–271, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. J. Gabbay and A. M. Pitts. A new approach to abstract syntax with variable binding. Formal Aspects of Computing, 13(3–5):341–363, 2000.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Hennessy. Symbolic debugging of optimized code. Transactions on Programming Languages and Systems, 4(3), 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Herman and M. Wand. A theory of hygienic macros. In European Symposium on Programming Languages and Systems, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. E. Kohlbecker, D. P. Friedman, M. Felleisen, and B. Duba. Hygienic macro expansion. In ACM Conference on LISP and Functional Programming, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. Konat, L. Kats, G. Wachsmuth, and E. Visser. Declarative name binding and scope rules. In Software Language Engineering, 2012.Google ScholarGoogle Scholar
  10. P. J. Landin. The mechanical evaluation of expressions. The Computer Journal, 6(4):308–320, 1964.Google ScholarGoogle ScholarCross RefCross Ref
  11. P. Neron, A. Tolmach, E. Visser, and G. Wachsmuth. A theory of name resolution. In European Symposium on Programming Languages and Systems, 2015. To appear.Google ScholarGoogle ScholarCross RefCross Ref
  12. F. Pfenning and C. Elliot. Higher-order abstract syntax. In Programming Languages Design and Implementation, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Pombrio and S. Krishnamurthi. Resugaring: Lifting evaluation sequences through syntactic sugar. In Programming Languages Design and Implementation, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. Sewell, F. Z. Nardelli, S. Owens, G. Peskine, T. Ridge, S. Sarkar, and R. Strnisa. Ott: Effective tool support for the working semanticist. In International Conference on Functional Programming, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Sperber, R. K. Dybvig, M. Flatt, A. van Straaten, R. Findler, and J. Matthews. Revised {6} Report on the Algorithmic Language Scheme. Cambridge University Press, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. P. Stansifer and M. Wand. Romeo: a system for more flexible bindingsafe programming. In International Conference on Functional Programming, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. Van Deursen, P. Klint, and F. Tip. Origin tracking. Journal of Symbolic Computation, 15(5–6), 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Weirich, B. Yorgey, and T. Sheard. Binders unbound. In International Conference on Functional Programming, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Hygienic resugaring of compositional desugaring

    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
    • Published in

      cover image ACM Conferences
      ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
      August 2015
      436 pages
      ISBN:9781450336697
      DOI:10.1145/2784731
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 50, Issue 9
        ICFP '15
        September 2015
        436 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2858949
        • Editor:
        • Andy Gill
        Issue’s Table of Contents

      Copyright © 2015 ACM

      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].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 29 August 2015

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate333of1,064submissions,31%

      Upcoming Conference

      ICFP '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader