Visible to the public Composable and Hygienic Typed Syntax Macros

TitleComposable and Hygienic Typed Syntax Macros
Publication TypeConference Paper
Year of Publication2015
AuthorsOmar, Cyrus, Wang, Chenglong, Aldrich, Jonathan
Conference NameProceedings of the 30th Annual ACM Symposium on Applied Computing
Conference LocationNew York, NY, USA
ISBN Number978-1-4503-3196-8
Keywordscomposability, compositionality, extensible syntax, hygiene, macros, pubcrawl, type inference

Syntax 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 supplement TSLs with typed syntax macros (TSMs), which, unlike TSLs, are explicitly invoked to give meaning to delimited segments of arbitrary syntax. To maintain a typing discipline, we describe two avors of term-level TSMs: synthetic TSMs specify the type of term that they generate, while analytic TSMs can generate terms of arbitrary type, but can only be used in positions where the type is otherwise known. At the level of types, we describe a third avor of TSM that generates a type of a specified kind along with its TSL and show interesting use cases where the two mechanisms operate in concert.

Citation Keyomar_composable_2015