TY - GEN
T1 - Marco
T2 - 26th European Conference on Object-Oriented Programming, ECOOP 2012
AU - Lee, Byeongcheol
AU - Grimm, Robert
AU - Hirzel, Martin
AU - McKinley, Kathryn S.
N1 - Copyright:
Copyright 2021 Elsevier B.V., All rights reserved.
PY - 2012
Y1 - 2012
N2 - Macros improve expressiveness, concision, abstraction, and language interoperability without changing the programming language itself. They are indispensable for building increasingly prevalent multilingual applications. Unfortunately, existing macro systems are well-encapsulated but unsafe (e.g., the C preprocessor) or are safe but tightly-integrated with the language implementation (e.g., Scheme macros). This paper introduces Marco, the first macro system that seeks both encapsulation and safety. Marco is based on the observation that the macro system need not know all the syntactic and semantic rules of the target language but must only directly enforce some rules, such as variable name binding. Using this observation, Marco off-loads most rule checking to unmodified target-language compilers and interpreters and thus becomes language-scalable. We describe the Marco language, its language-independent safety analysis, and how it uses two example target-language analysis plug-ins, one for C++ and one for SQL. This approach opens the door to safe and expressive macros for any language.
AB - Macros improve expressiveness, concision, abstraction, and language interoperability without changing the programming language itself. They are indispensable for building increasingly prevalent multilingual applications. Unfortunately, existing macro systems are well-encapsulated but unsafe (e.g., the C preprocessor) or are safe but tightly-integrated with the language implementation (e.g., Scheme macros). This paper introduces Marco, the first macro system that seeks both encapsulation and safety. Marco is based on the observation that the macro system need not know all the syntactic and semantic rules of the target language but must only directly enforce some rules, such as variable name binding. Using this observation, Marco off-loads most rule checking to unmodified target-language compilers and interpreters and thus becomes language-scalable. We describe the Marco language, its language-independent safety analysis, and how it uses two example target-language analysis plug-ins, one for C++ and one for SQL. This approach opens the door to safe and expressive macros for any language.
UR - http://www.scopus.com/inward/record.url?scp=84879728830&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84879728830&partnerID=8YFLogxK
U2 - 10.1007/978-3-642-31057-7_26
DO - 10.1007/978-3-642-31057-7_26
M3 - Conference contribution
AN - SCOPUS:84879728830
SN - 9783642310560
T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
SP - 589
EP - 613
BT - ECOOP 2012 - Object-Oriented Programming
PB - Springer Verlag
Y2 - 11 June 2012 through 16 June 2012
ER -