000231413 001__ 231413
000231413 005__ 20180913064521.0
000231413 037__ $$aREP_WORK
000231413 245__ $$aTwo approaches to portable macros
000231413 269__ $$a2017
000231413 260__ $$c2017
000231413 300__ $$a13
000231413 336__ $$aReports
000231413 520__ $$aFor any programming language that supports macros and has multiple   implementations (each with different AST definitions), there is a common   problem: how to make macros that operate on ASTs portable among     different compiler implementations?    Implementing portable macros is especially important for statically   typed languages like Scala, as IDE vendors usually have different   implementations of the language in order to support rich IDE   features. Unportable macros compromise IDE features and degrade   programming experience.    We describe two approaches to the portability problem based on two   different views on macros: (1) the tree-based approach,   which views macros as operations on abstract syntax trees, solves the   problem by defining standard abstract syntax trees; (2) the  syntax-based approach, which views macros as operations   on abstract syntax, solves the problem by defining standard   abstract syntax. We show that the latter has significant practical   advantages, especially in supporting semantic macros that use type   information of ASTs to transform user code.    Based on the idea, we implemented a new macro system, Gestalt,   for the experimental Scala compiler, Dotty. The new implementation   solves several long-standing problems of the current Scala macro   system and demonstrates advantages over alternative approaches. Our   solution has been adopted in the official new Scala macro system.
000231413 6531_ $$amacros
000231413 6531_ $$aScala
000231413 6531_ $$ameta-programming
000231413 6531_ $$aAST
000231413 6531_ $$aquasiquotes
000231413 700__ $$0249854$$aLiu, Fengyun$$g244269
000231413 700__ $$0246182$$aBurmako, Eugene$$g214505
000231413 8564_ $$s489060$$uhttps://infoscience.epfl.ch/record/231413/files/gestalt.pdf$$yn/a$$zn/a
000231413 909C0 $$0252187$$pLAMP$$xU10409
000231413 909CO $$ooai:infoscience.tind.io:231413$$pIC$$preport
000231413 917Z8 $$x244269
000231413 937__ $$aEPFL-REPORT-231413
000231413 973__ $$aEPFL
000231413 980__ $$aREPORT