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.
- M. D. Adams. Towards the essence of hygiene. In Principles of Programming Languages, 2015. Google Scholar
Digital Library
- A. Chlipala. Parametric higher-order abstract syntax for mechanized semantics. In International Conference on Functional Programming, 2008. Google Scholar
Digital Library
- S. Erdweg, T. van der Storm, and Y. Dai. Capture-avoiding and hygienic program transformations. In European Conference on Object-Oriented Programming, 2014.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- J. Hennessy. Symbolic debugging of optimized code. Transactions on Programming Languages and Systems, 4(3), 1982. Google Scholar
Digital Library
- D. Herman and M. Wand. A theory of hygienic macros. In European Symposium on Programming Languages and Systems, 2008. Google Scholar
Digital Library
- E. Kohlbecker, D. P. Friedman, M. Felleisen, and B. Duba. Hygienic macro expansion. In ACM Conference on LISP and Functional Programming, 1986. Google Scholar
Digital Library
- G. Konat, L. Kats, G. Wachsmuth, and E. Visser. Declarative name binding and scope rules. In Software Language Engineering, 2012.Google Scholar
- P. J. Landin. The mechanical evaluation of expressions. The Computer Journal, 6(4):308–320, 1964.Google Scholar
Cross Ref
- 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 Scholar
Cross Ref
- F. Pfenning and C. Elliot. Higher-order abstract syntax. In Programming Languages Design and Implementation, 1988. Google Scholar
Digital Library
- J. Pombrio and S. Krishnamurthi. Resugaring: Lifting evaluation sequences through syntactic sugar. In Programming Languages Design and Implementation, 2014. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- P. Stansifer and M. Wand. Romeo: a system for more flexible bindingsafe programming. In International Conference on Functional Programming, 2014. Google Scholar
Digital Library
- A. Van Deursen, P. Klint, and F. Tip. Origin tracking. Journal of Symbolic Computation, 15(5–6), 1993. Google Scholar
Digital Library
- S. Weirich, B. Yorgey, and T. Sheard. Binders unbound. In International Conference on Functional Programming, 2011. Google Scholar
Digital Library
Index Terms
Hygienic resugaring of compositional desugaring
Recommendations
Resugaring: lifting evaluation sequences through syntactic sugar
PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and ImplementationSyntactic sugar is pervasive in language technology. It is used to shrink the size of a core language; to define domain-specific languages; and even to let programmers extend their language. Unfortunately, syntactic sugar is eliminated by transformation,...
Inferring scope through syntactic sugar
Many languages use syntactic sugar to define parts of their surface language in terms of a smaller core. Thus some properties of the surface language, like its scoping rules, are not immediately evident. Nevertheless, IDEs, refactorers, and other tools ...
Resugaring: lifting evaluation sequences through syntactic sugar
PLDI '14Syntactic sugar is pervasive in language technology. It is used to shrink the size of a core language; to define domain-specific languages; and even to let programmers extend their language. Unfortunately, syntactic sugar is eliminated by transformation,...






Comments