Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3624007.3624052acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article
Open access

A pred-LL(*) Parsable Typed Higher-Order Macro System for Architecture Description Languages

Published: 22 October 2023 Publication History

Abstract

Macro systems are powerful language extension tools for Architecture Description Languages (ADLs). Their generative power in combination with the simplicity of specification languages allows for a substantial reduction of repetitive specification sections. This paper explores how the introduction of function- and record types in a template-based macro system impacts the specification of ADLs. We present design and implementation of a pattern-based syntax macro system for the Vienna Architecture Description Language (VADL). The macro system is directly integrated into the language and is analyzed at parse time using a context-sensitive pred-LL(*) parser. The usefulness of the macro system is illustrated by some typical macro application design patterns. The effectiveness is shown by a detailed evaluation of the Instruction Set Architecture (ISA) specification of five different processor architectures. The observed specification reduction can be up to 90 times, leading to improved maintainability, readability and runtime performance of the specifications.

References

[1]
Norman I Adams IV, David H Bartley, Gary Brooks, R Kent Dybvig, Daniel Paul Friedman, Robert Halstead, Chris Hanson, Christopher Thomas Haynes, Eugene Kohlbecker, and Don Oxley. 1998. Revised report on the algorithmic language Scheme. ACM Sigplan Notices, 33, 9 (1998), 26–76.
[2]
Rodolfo Azevedo, Sandro Rigo, Marcus Bartholomeu, Guido Araujo, Cristiano Araujo, and Edna Barros. 2005. The ArchC architecture description language and tools. International Journal of Parallel Programming, 33 (2005), 453–484.
[3]
Jonthan Bachrach and Keith Playford. 2001. The Java Syntactic Extender (JSE). In Proceedings of the 16th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA ’01). Association for Computing Machinery, New York, NY, USA. 31–42. isbn:1581133359 https://doi.org/10.1145/504282.504285
[4]
Jonathan Bachrach, Keith Playford, and C Street. 1999. D-expressions: Lisp power, Dylan style. Style DeKalb IL.
[5]
Michael Ballantyne, Alexis King, and Matthias Felleisen. 2020. Macros for Domain-Specific Languages. Proc. ACM Program. Lang., 4, OOPSLA (2020), Article 229, nov, 29 pages. https://doi.org/10.1145/3428297
[6]
Lorenzo Bettini. 2016. Implementing domain-specific languages with Xtext and Xtend. Packt Publishing Ltd.
[7]
Claus Brabrand and Michael I. Schwartzbach. 2002. Growing Languages with Metamorphic Syntax Macros. SIGPLAN Not., 37, 3 (2002), jan, 31–40. issn:0362-1340 https://doi.org/10.1145/509799.503035
[8]
R Kent Dybvig. 1992. Writing hygienic macros in Scheme with syntax-case. Citeseer.
[9]
Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Shriram Krishnamurthi, Eli Barzilay, Jay McCarthy, and Sam Tobin-Hochstadt. 2015. The Racket manifesto. In 1st Summit on Advances in Programming Languages (SNAPL 2015).
[10]
George Hadjiyiannis, Silvina Hanono, and Srinivas Devadas. 1997. ISDL: An Instruction Set Description Language for Retargetability. In Proceedings of the 34th Annual Design Automation Conference (DAC ’97). Association for Computing Machinery, New York, NY, USA. 299–302. isbn:0897919203 https://doi.org/10.1145/266021.266108
[11]
Kyle Headley. 2018. A DSL embedded in Rust. In Proceedings of the 30th Symposium on Implementation and Application of Functional Languages. 119–126.
[12]
Brian W Kernighan and Dennis M Ritchie. 1977. The M4 macro processor. Bell Laboratories Murray Hill, NJ.
[13]
Steve Klabnik and Carol Nichols. 2023. The Rust programming language. No Starch Press.
[14]
Eugene Kohlbecker, Daniel P Friedman, Matthias Felleisen, and Bruce Duba. 1986. Hygienic macro expansion. In Proceedings of the 1986 ACM Conference on LISP and Functional Programming. 151–161.
[15]
Benjamin Lamowski, Carsten Weinhold, Adam Lackorzynski, and Hermann Härtig. 2017. Sandcrust: Automatic sandboxing of unsafe components in Rust. In Proceedings of the 9th Workshop on Programming Languages and Operating Systems. 51–57.
[16]
Yannis Lilis and Anthony Savidis. 2019. A Survey of Metaprogramming Languages. ACM Comput. Surv., 52, 6 (2019), Article 113, oct, 39 pages. issn:0360-0300 https://doi.org/10.1145/3354584
[17]
Marcus Lindner, Jorge Aparicius, and Per Lindgren. 2018. No panic! Verification of Rust programs by symbolic execution. In 2018 IEEE 16th International Conference on Industrial Informatics (INDIN). 108–114.
[18]
Marjan Mernik, Jan Heering, and Anthony M Sloane. 2005. When and how to develop domain-specific languages. ACM computing surveys (CSUR), 37, 4 (2005), 316–344.
[19]
Terence Parr and Kathleen Fisher. 2011. LL (*) the foundation of the ANTLR parser generator. ACM Sigplan Notices, 46, 6 (2011), 425–436.
[20]
Terence J Parr and Russell W Quong. 1994. Adding semantic and syntactic predicates to LL (k): pred-LL (k). In Compiler Construction: 5th International Conference, CC’94 Edinburgh, UK, April 7–9, 1994 Proceedings 5. 263–277.
[21]
Stefan Pees, Andreas Hoffmann, Vojin Zivojnovic, and Heinrich Meyr. 1999. LISA — machine description language for cycle-accurate models of programmable DSP architectures. In Proceedings of the 36th Annual ACM/IEEE Design Automation Conference. 933–938.
[22]
Jon Rafkind and Matthew Flatt. 2012. Honu: Syntactic Extension for Algebraic Notation through Enforestation. In Proceedings of the 11th International Conference on Generative Programming and Component Engineering (GPCE ’12). Association for Computing Machinery, New York, NY, USA. 122–131. isbn:9781450311298 https://doi.org/10.1145/2371401.2371420
[23]
Richard M Stallman and Zachary Weinberg. 1987. The C preprocessor. Free Software Foundation, 16.
[24]
Guy Steele. 1990. Common LISP: the language. Elsevier.
[25]
Ken Wakita, Kanako Homizu, and Akira Sasaki. 2014. Hygienic Macro System for JavaScript and Its Light-Weight Implementation Framework. In Proceedings of ILC 2014 on 8th International Lisp Conference (ILC ’14). Association for Computing Machinery, New York, NY, USA. 12–21. isbn:9781450329316 https://doi.org/10.1145/2635648.2635653
[26]
Daniel Weise and Roger Crew. 1993. Programmable Syntax Macros. In Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation (PLDI ’93). Association for Computing Machinery, New York, NY, USA. 156–165. isbn:0897915984 https://doi.org/10.1145/155090.155105

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
GPCE 2023: Proceedings of the 22nd ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
October 2023
152 pages
ISBN:9798400704062
DOI:10.1145/3624007
This work is licensed under a Creative Commons Attribution 4.0 International License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 October 2023

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. architecture description language
  2. generative programming
  3. higher-order macros
  4. macro system
  5. pattern-based

Qualifiers

  • Research-article

Conference

GPCE '23
Sponsor:

Acceptance Rates

Overall Acceptance Rate 56 of 180 submissions, 31%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 275
    Total Downloads
  • Downloads (Last 12 months)257
  • Downloads (Last 6 weeks)41
Reflects downloads up to 18 Nov 2024

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media