skip to main content
research-article

Honu: syntactic extension for algebraic notation through enforestation

Published:26 September 2012Publication History
Skip Abstract Section

Abstract

Honu is a new language that fuses traditional algebraic notation (e.g., infix binary operators) with Scheme-style language extensibility. A key element of Honu's design is an enforestation parsing step, which converts a flat stream of tokens into an S-expression-like tree, in addition to the initial "read" phase of parsing and interleaved with the "macro-expand" phase. We present the design of Honu, explain its parsing and macro-extension algorithm, and show example syntactic extensions.

References

  1. Hiroshi Arai and Ken Wakita. An implementation of a hygienic syntactic macro system for JavaScript: a preliminary report. In Proc. Workshop on Self-Sustaining Systems, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Kevin Atkinson, Matthew Flatt, and Gary Lindstrom. ABI Compatibility Through a Customizable Language. In Proc. Generative Programming and Component Engineering, pp. 147--156, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Jonathan Bachrach and Keith Playford. Java Syntax Extender. In Proc. Object-Oriented, Programming, Systems, Languages, and Applications, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Jason Baker. Macros that Play: Migrating from Java to Myans. Masters dissertation, University of Utah, 2001.Google ScholarGoogle Scholar
  5. Cristiano Calcagno, Walid Taha, Liwen Huang, and Xavier Leroy. Implementing Multi-stage Languages Using ASTs, Gensym, and Reflection. In Proc. Generative Programming and Component Engineering, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Luca Cardelli and Florian Matthes. Extensible syntax with lexical scoping. Technical report, Research Report 121, Digital SRC, 1994.Google ScholarGoogle Scholar
  7. Russ Cox, Tom Bergan, Austin T. Clements, Frans Kaashoek, and Eddie Kohler. Xoc, an extension-oriented compiler for systems programming. In Proc. 13th Conference on Architectural Support for Programming Languages and Operating Systems, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Ryan Culpepper and Matthias Felleisen. Fortifying Macros. In Proc. ACM Intl. Conf. Functional Programming, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Daniel de Rauglaudre. Camlp4. 2007. http://brion.inria.fr/gallium/index.php/Camlp4Google ScholarGoogle Scholar
  10. Sebastian Erdweg, Tillmann Rendel, Christian Kästner, and Klaus Ostermann. SugarJ: Library-Based Syntactic Language Extensibility. In Proc. Object-Oriented, Programming, Systems, Languages, and Applications, pp. 391--406, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Robert Bruce Findler and Matthias Felleisen. Contracts for Higher-Order Functions. In Proc. ACM Intl. Conf. Functional Programming, pp. 48--59, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Matthew Flatt. Compilable and Composable Macros, You Want it When? In Proc. ACM Intl. Conf. Functional Programming, pp. 72--83, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Matthew Flatt, Ryan Culpepper, David Darais, and Robert Bruce Findler. Macros that Work Together: Compile-Time Bindings, Partial Expansion, and Definition Contexts. Journal of Functional Programming (to appear), 2012. http://www.cs.utah.edu/plt/expmodel-6/ Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Robert Grimm. Better extensibility through modular syntax. In Proc. Programming Language Design and Implementation pp. 38--51, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Heering, P. R. H. Hendriks, P. Klint, and J. Rekers. The Syntax Definition Formalism SDF---reference manual---.SIGPLAN Not. 24(11), pp. 43--75, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Simon Peyton Jones and Tim Sheard. Template metaprogramming for Haskell. In Proc. Haskell Workshop, Pitssburgh, pp. 1--16, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Richard Kelsey, William Clinger, and Jonathan Rees (Ed.). R5RS. ACM SIGPLAN Notices, Vol. 33, No. 9. (1998), pp. 26--76., 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Eugene Kohlbecker, Daniel P. Friedman, Matthias Felleisen, and Bruce Duba. Hygienic Macro Expansion. In Proc. Lisp and Functional Programming, pp. 151--181, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An Extensible Compiler Framework for Java. In Proc. 12th International Conference on Compiler Construction. pp. 138--152, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Vaughan R. Pratt. Top down operator precedence. In Proc. 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Ryan Culpepper, Sukyoung Ryu, Eric Allan, Janus Neilson, Jon Rafkind. Growing a Syntax. In Proc. FOOL 2009, 2009.Google ScholarGoogle Scholar
  22. Jonathan Riehl. Language embedding and optimization in mython. In Proc. DLS 2009. pp. 39--48, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Tiark Rompf and Martin Odersky. Lightweight Modular Staging: a Pragmatic Approach to Runtime Code Generation and Compiled DSLs. In Proc. Generative Programming and Component Engineering, pp. 127--136, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Andrew Shalit. Dylan Reference Manual. 1998. http://www.opendylan.org/books/drm/TitleGoogle ScholarGoogle Scholar
  25. Michael Sperber (Ed.). Revised6 Report on the Algorithmic Language Scheme. Cambridge University Press, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Sam Tobin-Hochstadt and Matthias Felleisen. Design and Implementation of Typed Scheme. Higher Order and Symbolic Computation, 2010.Google ScholarGoogle Scholar
  27. Masaru Tomita. An efficient context-free parsing algorithm for natural languages. International Joint Conference on Artificial Intelligence. pp. 756--764., 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Alessandro Warth and Ian Piumarta. Ometa: an Object-Oriented Language for Pattern Matching. In Proc. Dynamic Languages Symposium, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Daniel Weise and Roger Crew. Programmable syntax macros. In Proc. SIGPLAN Conference on Programming Language Design and Implementation, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Honu: syntactic extension for algebraic notation through enforestation

    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 48, Issue 3
      GPCE '12
      March 2013
      140 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2480361
      Issue’s Table of Contents
      • cover image ACM Conferences
        GPCE '12: Proceedings of the 11th International Conference on Generative Programming and Component Engineering
        September 2012
        148 pages
        ISBN:9781450311298
        DOI:10.1145/2371401

      Copyright © 2012 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 26 September 2012

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

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

    Learn more

    Got it!