[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article

Honu: syntactic extension for algebraic notation through enforestation

Published: 26 September 2012 Publication History

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.
[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.
[3]
Jonathan Bachrach and Keith Playford. Java Syntax Extender. In Proc. Object-Oriented, Programming, Systems, Languages, and Applications, 2001.
[4]
Jason Baker. Macros that Play: Migrating from Java to Myans. Masters dissertation, University of Utah, 2001.
[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.
[6]
Luca Cardelli and Florian Matthes. Extensible syntax with lexical scoping. Technical report, Research Report 121, Digital SRC, 1994.
[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.
[8]
Ryan Culpepper and Matthias Felleisen. Fortifying Macros. In Proc. ACM Intl. Conf. Functional Programming, 2010.
[9]
Daniel de Rauglaudre. Camlp4. 2007. http://brion.inria.fr/gallium/index.php/Camlp4
[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.
[11]
Robert Bruce Findler and Matthias Felleisen. Contracts for Higher-Order Functions. In Proc. ACM Intl. Conf. Functional Programming, pp. 48--59, 2002.
[12]
Matthew Flatt. Compilable and Composable Macros, You Want it When? In Proc. ACM Intl. Conf. Functional Programming, pp. 72--83, 2002.
[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/
[14]
Robert Grimm. Better extensibility through modular syntax. In Proc. Programming Language Design and Implementation pp. 38--51, 2006.
[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.
[16]
Simon Peyton Jones and Tim Sheard. Template metaprogramming for Haskell. In Proc. Haskell Workshop, Pitssburgh, pp. 1--16, 2002.
[17]
Richard Kelsey, William Clinger, and Jonathan Rees (Ed.). R5RS. ACM SIGPLAN Notices, Vol. 33, No. 9. (1998), pp. 26--76., 1998.
[18]
Eugene Kohlbecker, Daniel P. Friedman, Matthias Felleisen, and Bruce Duba. Hygienic Macro Expansion. In Proc. Lisp and Functional Programming, pp. 151--181, 1986.
[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.
[20]
Vaughan R. Pratt. Top down operator precedence. In Proc. 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages, 1973.
[21]
Ryan Culpepper, Sukyoung Ryu, Eric Allan, Janus Neilson, Jon Rafkind. Growing a Syntax. In Proc. FOOL 2009, 2009.
[22]
Jonathan Riehl. Language embedding and optimization in mython. In Proc. DLS 2009. pp. 39--48, 2009.
[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.
[24]
Andrew Shalit. Dylan Reference Manual. 1998. http://www.opendylan.org/books/drm/Title
[25]
Michael Sperber (Ed.). Revised6 Report on the Algorithmic Language Scheme. Cambridge University Press, 2011.
[26]
Sam Tobin-Hochstadt and Matthias Felleisen. Design and Implementation of Typed Scheme. Higher Order and Symbolic Computation, 2010.
[27]
Masaru Tomita. An efficient context-free parsing algorithm for natural languages. International Joint Conference on Artificial Intelligence. pp. 756--764., 1985.
[28]
Alessandro Warth and Ian Piumarta. Ometa: an Object-Oriented Language for Pattern Matching. In Proc. Dynamic Languages Symposium, 2007.
[29]
Daniel Weise and Roger Crew. Programmable syntax macros. In Proc. SIGPLAN Conference on Programming Language Design and Implementation, 1993.

Cited By

View all
  • (2020)Macros for domain-specific languagesProceedings of the ACM on Programming Languages10.1145/34282974:OOPSLA(1-29)Online publication date: 13-Nov-2020
  • (2024)Compiled, Extensible, Multi-language DSLs (Functional Pearl)Proceedings of the ACM on Programming Languages10.1145/36746278:ICFP(64-87)Online publication date: 15-Aug-2024
  • (2023)A pred-LL(*) Parsable Typed Higher-Order Macro System for Architecture Description LanguagesProceedings of the 22nd ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3624007.3624052(29-41)Online publication date: 22-Oct-2023
  • Show More Cited By

Index Terms

  1. Honu: syntactic extension for algebraic notation through enforestation

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    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
    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 ACM 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: 26 September 2012
    Published in SIGPLAN Volume 48, Issue 3

    Check for updates

    Author Tags

    1. hygiene
    2. infix syntax
    3. macros

    Qualifiers

    • Research-article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)12
    • Downloads (Last 6 weeks)3
    Reflects downloads up to 12 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2020)Macros for domain-specific languagesProceedings of the ACM on Programming Languages10.1145/34282974:OOPSLA(1-29)Online publication date: 13-Nov-2020
    • (2024)Compiled, Extensible, Multi-language DSLs (Functional Pearl)Proceedings of the ACM on Programming Languages10.1145/36746278:ICFP(64-87)Online publication date: 15-Aug-2024
    • (2023)A pred-LL(*) Parsable Typed Higher-Order Macro System for Architecture Description LanguagesProceedings of the 22nd ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3624007.3624052(29-41)Online publication date: 22-Oct-2023
    • (2023)Rhombus: A New Spin on Macros without All the ParenthesesProceedings of the ACM on Programming Languages10.1145/36228187:OOPSLA2(574-603)Online publication date: 16-Oct-2023
    • (2020)Macros for domain-specific languagesProceedings of the ACM on Programming Languages10.1145/34282974:OOPSLA(1-29)Online publication date: 13-Nov-2020
    • (2020)Online Xenophobic Behavior Amid the COVID-19 PandemicDigital Government: Research and Practice10.1145/34280912:1(1-5)Online publication date: 17-Nov-2020
    • (2020)Tweeting During the Covid-19 PandemicDigital Government: Research and Practice10.1145/34280902:1(1-7)Online publication date: 9-Nov-2020
    • (2020)Blockchains for GovernmentDigital Government: Research and Practice10.1145/34270971:3(1-21)Online publication date: 17-Nov-2020
    • (2020)A Semantically Rich Framework for Knowledge Representation of Code of Federal RegulationsDigital Government: Research and Practice10.1145/34251921:3(1-17)Online publication date: 23-Nov-2020
    • (2020)Being Fair about the Design of FAIR Data StandardsDigital Government: Research and Practice10.1145/33996321:3(1-7)Online publication date: 29-Sep-2020
    • Show More Cited By

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media