ABSTRACT
We describe an s-expression based syntax-extension framework much like Scheme macros, with a key additional facility: the ability to define static semantics, such as type systems or program analysis, for the new, user-defined forms or embedded languages, thus allowing us to construct "towers" of language levels. In addition, the static semantics of the languages at two adjacent levels in the tower can be connected, allowing improved reasoning power at a higher (and perhaps more restricted) level to be reflected down to the static semantics of the language level below. We demonstrate our system by designing macros for an assembly language, together with some example static analyses (termination analysis, type inference and control-flow analysis).
- Alan Bawden. Reification without evaluation. In LFP '88: Proceedings of the 1988 ACM conference on LISP and functional programming, pages 342--349, New York, NY, USA, 1988. ACM Press.]] Google Scholar
Digital Library
- William Clinger. Macros that work. In POPL '91: Proceedings of the 18th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 155--162, New York, NY, USA, 1991. ACM Press.]] Google Scholar
Digital Library
- R. Kent Dybvig, Robert Hieb, and Carl Bruggeman. Syntactic abstraction in scheme. Lisp Symb. Comput., 5(4):295--326, 1992.]] Google Scholar
Digital Library
- Robert Bruce Findler, John Clements, Matthew Flatt Cormac Flanagan, Shriram Krishnamurthi, Paul Steckler, and Matthias Felleisen. DrScheme: A progamming environment for Scheme. Journal of Functional Programming, 12(2):159--182, March 2002.]] Google Scholar
Digital Library
- Matthew Flatt. Composable and compilable macros: you want it when? In ICFP '02: Proceedings of the seventh ACM SIGPLAN international conference on Functional programming, pages 72--83, New York, NY, USA, 2002. ACM Press.]] Google Scholar
Digital Library
- Dan Friedman. Object-oriented style. Invited talk at International LISP Conference, October 2003.]]Google Scholar
- Daniel P. Friedman, William E. Byrd, and Oleg Kiselyov. The Reasoned Schemer. The MIT Press, Cambridge, MA, 2005.]] Google Scholar
Digital Library
- Kathryn E Gray and Matthew Flatt. Compiling Java to PLT Scheme. In Proceedings of the 2004 Scheme Workshop, September 2004.]]Google Scholar
- Graham Hutton and ErikMeijer. Monadic Parsing in Haskell. Journal of Functional Programming, 8(4):437--444, July 1998.]] Google Scholar
Digital Library
- R. Kelsey, W. Clinger, and J. Rees (eds.). Revised5 report on the algorithmic language Scheme. Higher-Order and Symbolic Computations, 11(1), August 1998.]] Google Scholar
Digital Library
- Shriram Krishnamurthi, Yan-David Erlich, and Matthias Felleisen. Expressing structural properties as language constructs. In ESOP '99: Proceedings of the 8th European Symposium on Programming Languages and Systems, pages 258--272, London, UK, 1999. Springer-Verlag.]] Google Scholar
Digital Library
- Shriram Krishnamurthi and Matthias Felleisen. Toward a formal theory of extensible software. In SIGSOFT '98/FSE-6: Proceedings of the 6th ACM SIGSOFT international symposium on Foundations of software engineering, pages 88--98, New York, NY, USA, 1998. ACM Press.]] Google Scholar
Digital Library
- Shriram Krishnamurthi, Matthias Felleisen, and Bruce F. Duba. From macros to reusable generative programming. In GCSE '99: Proceedings of the First International Symposium on Generative and Component-Based Software Engineering, pages 105--120, London, UK, 2000. Springer-Verlag.]] Google Scholar
Digital Library
- Daan Leijen and Erik Meijer. Parsec: Direct style monadic parser combinators for the real world. Technical Report UU-CS-2001-27, Department of Computer Science, Universiteit Utrecht, 2001.]]Google Scholar
- William Maddox. Semantically-sensitive macroprocessing. Technical report, University of California at Berkeley, Berkeley, CA, USA, 1989.]] Google Scholar
Digital Library
- Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From system F to typed assembly language. ACM Trans. Program. Lang. Syst., 21(3):527--568, 1999.]] Google Scholar
Digital Library
- Ravi A. Nanavati. Extensible syntax in the presence of static analysis. MasterÆs thesis, Massachusetts Institute of Technology, September 2000.]]Google Scholar
- Benjamin Pierce, editor. Advanced Topics in Types and Programming Languages. The MIT Press, Cambridge, MA, 2005.]] Google Scholar
Digital Library
- Francois Pottier and Didier Remy. The Essence of ML Type Inference, pages 389--489. In Pierce {18}, 2005.]]Google Scholar
- Olin Shivers. Control-Flow Analysis of Higher-Order Languages, or Taming Lambda. PhD thesis, School of Computer Science, Carnegie Mellon University, Pittsburgh, Pennsylvania, May 1991. Technical Report CMU-CS-91-145.]] Google Scholar
Digital Library
- Olin Shivers. The anatomy of a loop: a story of scope and control. In Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming (ICFP 2005), pages 2--14, Tallinn, Estonia, September 2005. ACM Press.]] Google Scholar
Digital Library
- Randall B. Smith and David Ungar. Programming as an experience: The inspiration for Self. In ECOOP '95: Proceedings of the 9th European Conference on Object-Oriented Programming, pages 303--330, London, UK, 1995. Springer-Verlag.]] Google Scholar
Digital Library
- Walid Taha and Tim Sheard. Multi-stage programming with explicit annotations. In PEPM '97: Proceedings of the 1997 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, pages 203--217, New York, NY, USA, 1997. ACM Press.]] Google Scholar
Digital Library
- David Ungar and Randall B. Smith. Self: The power of simplicity. In OOPSLA '87: Conference proceedings on Object-oriented programming systems, languages and applications, pages 227--242, New York, NY, USA, 1987. ACM Press.]] Google Scholar
Digital Library
- Dale Vaillancourt. ACL2 in DrScheme. http://www.ccs.neu.edu/home/dalev/acl2-drscheme/.]]Google Scholar
- Mitchell Wand. Complete type inference for simple objects. In Proceedings of the IEEE Symposium on Logic in Computer Science, June 1987.]]Google Scholar
- Daniel Weise and Roger Crew. Programmable syntax macros. SIGPLAN Not., 28(6):156--165, 1993.]] Google Scholar
Digital Library
- Eric Van Wyk, Oege de Moor, Kevin Backhouse, and Paul Kwiatkowski. Forwarding in attribute grammars for modular language design. In CC '02:Proceedings of the 11th International Conference on Compiler Construction, pages 128--142, London, UK, 2002. Springer-Verlag.]] Google Scholar
Digital Library
Index Terms
Static analysis for syntax objects
Recommendations
Static analysis for syntax objects
Proceedings of the 2006 ICFP conferenceWe describe an s-expression based syntax-extension framework much like Scheme macros, with a key additional facility: the ability to define static semantics, such as type systems or program analysis, for the new, user-defined forms or embedded languages,...
Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions
OOPSLA '04Application programmer's interfaces give access to domain knowledge encapsulated in class libraries without providing the appropriate notation for expressing domain composition. Since object-oriented languages are designed for extensibility and reuse, ...
Composable and hygienic typed syntax macros
SAC '15: Proceedings of the 30th Annual ACM Symposium on Applied ComputingSyntax extension mechanisms are powerful, but reasoning about syntax extensions can be difficult. Recent work on type-specific languages (TSLs) addressed reasoning about composition, hygiene and typing for extensions introducing new literal forms. We ...







Comments