Proceedings Article10.1145/512529.512562
Maya: multiple-dispatch syntax extension in Java
Jason Baker,Wilson C. Hsieh +1 more
- 17 May 2002
- Vol. 37, Iss: 5, pp 270-281
TL;DR: The design and implementation of Maya are described, a version of Java that allows programmers to extend and reinterpret its syntax, and how its novel parsing techniques work and how Maya can statically detect certain kinds of errors are described.
read more
Abstract: We have designed and implemented Maya, a version of Java that allows programmers to extend and reinterpret its syntax. Maya generalizes macro systems by treating grammar productions as generic functions, and semantic actions on productions as multimethods on the corresponding generic functions. Programmers can write new generic functions (i.e., grammar productions) and new multimethods (i.e., semantic actions), through which they can extend the grammar of the language and change the semantics of its syntactic constructs, respectively. Maya's multimethods are compile-time metaprograms that transform abstract syntax: they execute at program compile-time, because they are semantic actions executed by the parser. Maya's multimethods can be dispatched on the syntactic structure of the input, as well as the static, source-level types of expressions in the input. In this paper we describe what Maya can do and how it works. We describe how its novel parsing techniques work and how Maya can statically detect certain kinds of errors, such as code that generates references to free variables. Finally, to demonstrate Maya's expressiveness, we describe how Maya can be used to implement the MultiJava language, which was described by Clifton et al. at OOPSLA 2000.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
Polyglot: an extensible compiler framework for Java
Nathaniel Nystrom,Michael R. Clarkson,Andrew C. Myers +2 more
- 07 Apr 2003
TL;DR: This paper focuses on the design choices in Polyglot that are important for making the framework usable and highly extensible.
Composable and compilable macros: you want it when?
Matthew Flatt
- 17 Sep 2002
TL;DR: MzScheme---the language of the PLT Scheme tool suite---addresses the problem of mingling through a macro system that separates compilation without sacrificing the expressiveness of macros.
Jeannie: granting java native interface developers their wishes
Martin Hirzel,Robert Grimm +1 more
- 21 Oct 2007
TL;DR: Jeannie is presented, a new language design for integrating Java with C that eliminates verbose boiler-plate code, enables static error detection across the language boundary, and simplifies dynamic resource management.
Runtime aspect weaving through metaprogramming
Jason Baker,Wilson C. Hsieh +1 more
- 22 Apr 2002
TL;DR: An extension to the Java language, Handi-Wrap, that supports weaving aspects into code at runtime, in the form of method wrappers, which allow aspect code to be inserted around method bodies like advice in AspectJ.
Generating AspectJ Programs with Meta-AspectJ
David Zook,Shan Shan Huang,Yannis Smaragdakis +2 more
- 24 Oct 2004
TL;DR: Meta-AspectJ is a language tool for generating AspectJ programs using code templates that minimizes the number of meta-programming (quote/unquote) operators and uses type inference to reduce the need to remember type names for syntactic entities.
71
References
•Book
Design Patterns: Elements of Reusable Object-Oriented Software
Erich Gamma,Richard Helm,Ralph E. Johnson,John Vlissides +3 more
- 01 Jan 1994
TL;DR: The book is an introduction to the idea of design patterns in software engineering, and a catalog of twenty-three common patterns, which most experienced OOP designers will find out they've known about patterns all along.
24.8K
•Book
Compilers: Principles, Techniques, and Tools
Alfred V. Aho,Ravi Sethi,Jeffrey D. Ullman +2 more
- 01 Jan 1986
TL;DR: This book discusses the design of a Code Generator, the role of the Lexical Analyzer, and other topics related to code generation and optimization.
9.7K
Revised report on the algorithm language ALGOL 60
J. W. Backus,Friedrich L. Bauer,J. Green,C. Katz,John J. McCarthy,Alan J. Perlis,Heinz Rutishauser,K. Samelson,B. Vauquois,J. H. Wegstein,A. van Wijngaarden,M. Woodger,Peter Naur +12 more
TL;DR: A survey of the basic coustituents arid fcuturcs of the language is given, and the formal notation, by which the syntactic structure is defined, is explained.
950
•Book
Revised [6] Report on the Algorithmic Language Scheme
Norman Adams,D. H. Bartley,G. Brooks,R. K. Dybvig,D. P. Friedman,R. Halstead,C. Hanson,Christopher T. Haynes,E. Kohlbecker,D. Oxley,K. M. Pitman,G. J. Rozas,G. L. Steele,G. J. Sussman,M. Wand,Hal Abelson +15 more
- 01 Apr 2010
TL;DR: The report gives a defining description of the programming language Scheme, a statically scoped and properly tail-recursive dialect of the Lisp programming language invented by Guy Lewis Steele, Jr. and Gerald Jay Sussman.
MultiJava: modular open classes and symmetric multiple dispatch for Java
Curtis Clifton,Gary T. Leavens,Craig Chambers,Todd Millstein +3 more
- 01 Oct 2000
TL;DR: MultiJava is presented, a backward-compatible extension to Java supporting open classes and symmetric multiple dispatch, and adapt previous theoretical work to allow compilation units to be statically typechecked modularly and safely, ruling out any link-time or run-time type errors.
Related Papers (5)
Don Batory,B. Lofaso,Yannis Smaragdakis +2 more
- 02 Jun 1998
Daniel Weise,Roger F. Crew +1 more
- 01 Jun 1993