ACM Home Page
Please provide us with feedback. Feedback
Maya: multiple-dispatch syntax extension in Java
Full text PdfPdf (153 KB)
Source Conference on Programming Language Design and Implementation archive
Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation table of contents
Berlin, Germany
SESSION: Language Design & Implementation Issues table of contents
Pages: 270 - 281  
Year of Publication: 2002
ISBN:1-58113-463-0
Also published in ...
Authors
Jason Baker  University of Utah
Wilson C. Hsieh  University of Utah
Sponsor
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 7,   Downloads (12 Months): 61,   Citation Count: 17
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/512529.512562
What is a DOI?

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.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
2
 
3
J. Baker. Macros that play: Migrating from Java to Maya. Master's thesis, University of Utah, Dec. 2001. http://www.cs.utah.edu/~jbaker/maya/thesis.html
4
 
5
6
7
 
8
L. Cardelli, F. Matthes, and M. Abadi. Extensible syntax with lexical scoping. Technical Report 121, DEC SRC, Feb. 1994
 
9
C. Chambers. The Cecil Language Specification and Rationale: Version 2.0, 1995
10
 
11
C. Clifton. The MultiJava project. http://www.cs.iastate.edu/~cclifton/multijava/index.shtml
12
13
 
14
D. de Rauglaudre. Camlp4 reference manual. http://caml.inria.fr/camlp4/manual/, Jan. 2002
 
15
W. Divoky, C. Forgione, T. Graf, C. Laborde, A. Lemonnier, and E. Wais. The Kopi project. http://www.dms.at/kopi/index.html
16
 
17
 
18
 
19
20
 
21
R. Kelsey, W. Clinger, and J. Rees (Eds.). The revised report on the algorithmic language Scheme. ACM SIGPLAN Notices, 33(9), Sept. 1998
 
22
 
23
 
24
W. Maddox. Semantically-sensitive macroprocessing. Master's thesis, University of California, Berkeley, 1989
 
25
Microsoft. C# language specification. http://msdn.microsoft.com/library/dotnet/csspec/vclrfcsharpspec_Start.htm
26
 
27
A. Shalit. Dylan Reference Manual. Addison-Wesley, 1996
 
28
 
29
M. Tatsubori, S. Chiba, M. Killijian, and K. Itano. OpenJava: A class-based macro system for Java. In Proceedings of the OOPSLA '00 Reflection and Software Engineering Workshop, Minneapolis, MN, Oct. 2000
30
 
31
Xerox. The AspectJ programming guide. http://www.aspectj.org/doc/dist/progguide/

CITED BY  17

Collaborative Colleagues:
Jason Baker: colleagues
Wilson C. Hsieh: colleagues