Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

The jastadd extensible java compiler

Published: 21 October 2007 Publication History

Abstract

The JastAdd Extensible Java Compiler is a high quality Java compiler that is easy to extend in order to build static analysis tools for Java, and to extend Java with new language constructs. It is built modularly, with a Java 1.4 compiler that is extended to a Java 5 compiler. Example applications that are built as extensions include an alternative backend that generates Jimple, an extension of Java with AspectJ constructs, and the implementation of a pluggable type system for non-null checking and inferenc.
The system is implemented using JastAdd, a declarative Java-like language. We describe the compiler architecture, the major design ideas for building and extending the compiler, in particular, for dealing with complex extensions that affect name and type analysis. Our extensible compiler compares very favorably concerning quality, speed and size with other extensible Java compiler frameworks. It also compares favorably in quality and size compared with traditional non-extensible Java compilers, and it runs within a factor of three compared to javac.

References

[1]
Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhoták, Ondrej Lhoták, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. abc: An extensible AspectJ compiler. Transactions on Aspect-Oriented Software Development, 1(1), 2006.
[2]
Per Andersson. Efficient modelling and synthesis of data intensive reconfigurable systems. PhD thesis, Lund University, Sweden, June 2005.
[3]
ajc in the AspectJ project, 1.5.0, 2007. http://www.eclipse.org/aspectj/.
[4]
Kim B. Bruce, Luca Cardelli, Giuseppe Castagna, Jonathan Eifrig, Scott F. Smith, Valery Trifonov, Gary T. Leavens, and Benjamin C. Pierce. On binary methods. Theory and Practice of Object Systems, 1(3):221--242, 1995.
[5]
S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, Dvon Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of OOPSLA'06. ACM Press, October 2006.
[6]
Jonthan Bachrach and Keith Playford. The Java syntactic extender (JSE). In Proceedings of OOPSLA'01, pages 31--42. ACM Press, 2001.
[7]
Gilad Bracha. Pluggable Type Systems. In OOPSLA'04 workshop on revival of dynamic languages, 2004.
[8]
Martin Bravenboer and Eelco Visser. Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In Proceedings of OOPSLA'04, pages 365--383. ACM Press, October 2004.
[9]
Eclipse Java Compiler, Eclipse Java Development Tools 3.1.2, 2007. http://download.eclipse.org/eclipse/downloads/drops/R--3.1.2--200601181600% /index.php.
[10]
Torbjörn Ekman and Görel Hedin. Rewritable Reference Attributed Grammars. In Proceedings of ECOOP 2004, volume 3086 of LNCS, pages 144--169. Springer, 2004.
[11]
Torbjörn Ekman and Görel Hedin. Modular name analysis for Java using JastAdd. In Generative and Transformational Techniques in Software Engineering, International Summer School, GTTSE 2005, volume 4143 of LNCS. Springer, 2006.
[12]
Torbjörn Ekman and Görel Hedin. Pluggable checking and inferencing of non-null types for Java. Proceedings of TOOLS Europe 2007, Journal of Object Technology, 6(7), 2007.
[13]
Torbjörn Ekman. Extensible Compiler Construction. PhD thesis, Lund University, Sweden, June 2006.
[14]
M. Fahndrich and K. Rustan M. Leino. Declaring and checking non-null types in an object-oriented language. In Proceedings of OOPSLA'03, pages 302--312, 2003.
[15]
James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. The Java Language Specification Second Edition. Addison-Wesley, Boston, Mass., 2000.
[16]
Görel Hedin. Reference Attributed Grammars. In Informatica (Slovenia), 24(3), pages 301--317, 2000.
[17]
Görel Hedin and Eva Magnusson. JastAdd: an aspect-oriented compiler construction system. Science of Computer Programming, 47(1):37--58, 2003.
[18]
DHH. Ingalls. A simple technique for handling multiple polymorphism. In Proceedings of OOPSLA'86, pages 347--349, 1986.
[19]
The Jacks compiler test suite, 2007. http://sources.redhat.com/mauve/.
[20]
JaCo Java Compiler, The Programming Language Keris, 2007. http://lampwww.epfl.ch/~zenger/keris/.
[21]
JastAdd, 2007. http://jastadd.cs.lth.se/web/.
[22]
Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. An overview of AspectJ. In Proceedings of ECOOP 2001, volume 2072 of LNCS, pages 327--355. Springer, 2001.
[23]
Donald E. Knuth. Semantics of context-free languages. Mathematical Systems Theory, 2(2):127--145, June 1968. Correction: Mathematical Systems Theory 5, 1, pp. 95--96 (March 1971).
[24]
Uwe Kastens and William M. Waite. Modularity and reusability in attribute grammars. Acta Informatica, 31(7):601--627, 1994.
[25]
E. Magnusson and G. Hedin. Circular Reference Attributed Grammars-Their Evaluation and Applications. Electr. Notes Theor. Comput. Sci., 82(3), 2003.
[26]
Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for java. In Compiler Construction, 12th International Conference, CC 2003, volume 2622 of LNCS, pages 138--152. Springer, 2003.
[27]
Anders Nilsson. Tailoring native compilation of Java for real-time systems. PhD thesis, Lund University, Sweden, May 2006.
[28]
Palpable Computing - a new perspective on Ambient Computing, 2007. http://www.ist-palcom.org.
[29]
Yannis Smaragdakis and Don Batory. Mixin layers: an object-oriented implementation technique for refinements and collaboration-based designs. ACM Trans. Softw. Eng. Methodol., 11(2):215--255, 2002.
[30]
Milan Stanojevic and Todd Millstein. Java 5 extension for Polyglot compiler framework, 2007. http://www.cs.ucla.edu/~milanst/projects/polyglot5/.
[31]
Michiaki Tatsubori, Shigeru Chiba, Kozo Itano, and Marc-Olivier Killijian. OpenJava: A Class-Based Macro System for Java. In Proceedings of the 1st OOPSLA Workshop on Reflection and Software Engineering, pages 117--133. Springer, 2000.
[32]
Raja Vallée-Rai, Laurie Hendren, Vijay Sundaresan, Patrick Lam, Etienne Gagnon, and Phong Co. Soot-a Java Optimization Framework. In Proceedings of CASCON 1999, pages 125--135, 1999.
[33]
H. H. Vogt, S. D. Swierstra, and M. F. Kuiper. Higher order attribute grammars. In Proceedings of PLDI '89, pages 131--145. ACM Press, 1989.
[34]
David A. Wheeler. SLOCCount, 2007. http://www.dwheeler.com/sloccount/.
[35]
Eric Van Wyk, Lijesh Krishnan, August Schwerdfeger, and Derek Bodin. Attribute Grammar-based Language Extensions for Java. In Proceedings of ECOOP'07, LNCS. Springer, 2007.
[36]
Matthias Zenger and Martin Odersky. Extensible algebraic datatypes with defaults. In Proceedings of ICFP'01, pages 241--252. ACM Press, 2001.
[37]
Matthias Zenger and Martin Odersky. Implementing extensible compilers. In Workshop on Multiparadigm Programming with Object-Oriented allLanguages, Budapest, Hungary, June 2001.
[38]
Johan Åkesson, Torbjörn Ekman, and Görel Hedin. Development of a Modelica compiler using Jast-Add. In Proceedings of LDTA'07. Electr. Notes Theor. Comput. Sci., 2007.

Cited By

View all
  • (2024)Property probesJournal of Systems and Software10.1016/j.jss.2024.111980211:COnline publication date: 2-Jul-2024
  • (2024)Zipper-based embedding of strategic attribute grammarsJournal of Systems and Software10.1016/j.jss.2024.111975211(111975)Online publication date: May-2024
  • (2023)Efficient Embedding of Strategic Attribute Grammars via MemoizationProceedings of the 2023 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3571786.3573019(41-54)Online publication date: 15-Jan-2023
  • Show More Cited By

Index Terms

  1. The jastadd extensible java compiler

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 42, Issue 10
    Proceedings of the 2007 OOPSLA conference
    October 2007
    686 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1297105
    Issue’s Table of Contents
    • cover image ACM Conferences
      OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applications
      October 2007
      728 pages
      ISBN:9781595937865
      DOI:10.1145/1297027
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 21 October 2007
    Published in SIGPLAN Volume 42, Issue 10

    Check for updates

    Author Tags

    1. OOP
    2. compilers
    3. declarative frameworks
    4. extensibility
    5. java
    6. modularity

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)37
    • Downloads (Last 6 weeks)6
    Reflects downloads up to 03 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Property probesJournal of Systems and Software10.1016/j.jss.2024.111980211:COnline publication date: 2-Jul-2024
    • (2024)Zipper-based embedding of strategic attribute grammarsJournal of Systems and Software10.1016/j.jss.2024.111975211(111975)Online publication date: May-2024
    • (2023)Efficient Embedding of Strategic Attribute Grammars via MemoizationProceedings of the 2023 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation10.1145/3571786.3573019(41-54)Online publication date: 15-Jan-2023
    • (2022)Property Probes: Source Code Based Exploration of Program Analysis ResultsProceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3567512.3567525(148-160)Online publication date: 29-Nov-2022
    • (2022)Zipping Strategies and Attribute GrammarsFunctional and Logic Programming10.1007/978-3-030-99461-7_7(112-132)Online publication date: 3-May-2022
    • (2021)JavaDL: automatically incrementalizing Java bug pattern detectionProceedings of the ACM on Programming Languages10.1145/34855425:OOPSLA(1-31)Online publication date: 15-Oct-2021
    • (2021)Java Typestate CheckerCoordination Models and Languages10.1007/978-3-030-78142-2_8(121-133)Online publication date: 8-Jun-2021
    • (2020)Knowing when to ask: sound scheduling of name resolution in type checkers derived from declarative specificationsProceedings of the ACM on Programming Languages10.1145/34282484:OOPSLA(1-28)Online publication date: 13-Nov-2020
    • (2020)Principles and patterns of JastAdd-style reference attribute grammarsProceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3426425.3426934(86-100)Online publication date: 16-Nov-2020
    • (2018)A constraint-logic object-oriented languageProceedings of the 33rd Annual ACM Symposium on Applied Computing10.1145/3167132.3167260(1185-1194)Online publication date: 9-Apr-2018
    • Show More Cited By

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media