ABSTRACT
Language extensions increase programmer productivity by providing concise, often domain-specific syntax, and support for static verification of correctness, security, and style constraints. Language extensions can often be realized through translation to the base language, supported by preprocessors and extensible compilers. However, various kinds of extensions require further adaptation of a base compiler's internal stages and components, for example to support separate compilation or to make use of low-level primitives of the platform (e.g., jump instructions or unbalanced synchronization). To allow for a more loosely coupled approach, we propose an open compiler model based on normalization steps from a high-level language to a subset of it, the core language. We developed such a compiler for a mixed Java and (core) bytecode language, and evaluate its effectiveness for composition mechanisms such as traits, as well as statement-level and expression-level language extensions.
- A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools (2nd Edition). Addison Wesley, August 2006. Google Scholar
- P. Avgustinov, A. S. Christensen, L. Hendren, S. Kuzins, J. Lhoták, O. Lhoták, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. abc: an extensible AspectJ compiler. In Aspect-oriented software development (AOSD'05), pages 87--98, New York, NY, USA, 2005. ACM. Google Scholar
- J. Bachrach and K. Playford. The Java syntactic extender (JSE). In Proceedings of the 16th ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications (OOPSLA'01), volume 36 of ACM SIGPLAN Notices, pages 31--42, New York, NY, USA, 2001. ACM. Google Scholar
- M. G. J. van den Brand, J. Scheerder, J. Vinju, and E. Visser. Disambiguation filters for scannerless generalized LR parsers. In N. Horspool, editor, Compiler Construction (CC 2002), volume 2304 of Lecture Notes in Computer Science, pages 143--158, Grenoble, France, April 2002. Springer-Verlag. Google Scholar
- M. Bravenboer, E. Dolstra, and E. Visser. Preventing injection attacks with syntax embeddings. A host and guest language independent approach. In J. Lawall, editor, Generative Programming and Component Engineering (GPCE 2007), pages 3--12, New York, NY, USA, October 2007. ACM. Google Scholar
- M. Bravenboer, K. T. Kalleberg, R. Vermaas, and E. Visser. Stratego/XT 0.17. A language and toolset for program transformation. Science of Computer Programming, 72(1-2):52--70, June 2008. Special issue on experimental software and toolkits. Google Scholar
- M. Bravenboer and E. Visser. Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In D. C. Schmidt, editor, Proceedings of the 19th ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA'04), pages 365--383, Vancouver, Canada, October 2004. ACM Press. Google Scholar
- C. Clifton. MultiJava: Design, implementation, and evaluation of a Java-compatible language supporting modular open classes and symmetric multiple dispatch. Technical Report 01-10, Department of Computer Science, Iowa State University, Nov. 2001.Google Scholar
- C. Clifton, T. Millstein, G. T. Leavens, and C. Chambers. Multijava: Design rationale, compiler implementation, and applications. ACM Transactions on Programming Languages and Systems (TOPLAS), 28(3):517--575, 2006. Google Scholar
- J. Danaher, I. Angelina Lee, and C. Leiserson. Programming with exceptions in JCilk. Science of Computer Programming, 63(2):147--171, 2006. Google Scholar
- A. B. Dov. infomancers-collections. http://code.google.com/p/infomancers-collections/Google Scholar
- S. Ducasse, O. Nierstrasz, N. Schärli, R. Wuyts, and A. Black. Traits: A mechanism for fine-grained reuse. ACM Transactions on Programming Languages and Systems (TOPLAS), 28(2):331--388, 2006. Google Scholar
- T. Ekman and G. Hedin. The JastAdd extensible Java compiler. In Proceedings of the 22nd ACM SIGPLAN conference on Object-oriented programming systems and applications (OOPSLA'07), pages 1--18, New York, NY, USA, 2007. ACM. Google Scholar
- J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java Language Specification. Prentice Hall PTR, Boston, Mass., third edition, 2005. Google Scholar
- J. C. Hardwick and J. Sipelstein. Java as an intermediate language. Technical Report CMU-CS-96-161, School of Computer Science, Carnegie Mellon University, August 1996.Google Scholar
- Z. Hemel, L. C. L. Kats, and E. Visser. Code generation by model transformation. A case study in transformation modularity. In J. Gray, A. Pierantonio, and A. Vallecillo, editors, Proceedings of the International Conference on Model Transformation (ICMT 2008), volume 5063 of Lecture Notes in Computer Science, pages 183--198. Springer, June 2008. Google Scholar
- M. Hirzel and R. Grimm. Jeannie: granting Java Native Interface developers their wishes. In R. P. Gabriel, D. F. Bacon, C. V. Lopes, and G. L. S. Jr., editors, Object-Oriented Programming, Systems, Languages, and Applications, (OOPSLA'07), pages 19--38. ACM, 2007. Google Scholar
- J. B. Kam and J. D. Ullman. Monotone data flow analysis frameworks. Acta Inf., 7:305--317, 1977.Google Scholar
- L. C. L. Kats. java-csharp: C#-inspired language extensions for Java. http://strategoxt.org/Stratego/JavaCSharp/.Google Scholar
- G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-oriented programming. In M. Aks¸it and S. Matsuoka, editors, Proceedings of the European Conference on Object-Oriented Programming (ECOOP'07), volume 1241 of Lecture Notes in Computer Science, pages 220--242. Springer, 1997.Google Scholar
- S. Liang. Java Native Interface: Programmer's Guide and Reference. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1999. Google Scholar
- T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, second edition, 1999. Google Scholar
- F. Logozzo and M. Fähndrich. On the relative completeness of bytecode analysis versus source code analysis. In L. Hendren, editor, Compiler Construction (CC'08), volume 4959 of Lecture Notes in Computer Science, pages 192--212. Springer, 2008. Google Scholar
- J. Melton and A. Eisenberg. Understanding SQL and Java Together: A Guide to SQLJ, JDBC, and Related Technologies. Morgan Kaufmann, 2000. Google Scholar
- J. Meyer and T. Downing. Java Virtual Machine. O'Reilly & Associates, Inc., Sebastopol, CA, USA, 1997. Google Scholar
- J. Miecznikowski and L. Hendren. Decompiling Java using staged encapsulation. Workshop on Decompilation Techniques, appeared in Proceedings of the Working Conference on Reverse Engineering (WCRE'01), pages 368--374, 2001. Google Scholar
- S. Murer, S. Omohundro, D. Stoutamire, and C. Szyperski. Iteration abstraction in Sather. ACM Transactions on Programming Languages and Systems (TOPLAS), 18(1):1--15, 1996. Google Scholar
- N. Nystrom, M. Clarkson, and A. Myers. Polyglot: An Extensible Compiler Framework for Java. Compiler Construction (CC'03), 2622:138--152, Apr. 2003. Google Scholar
- M. Odersky and al. An overview of the Scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland, 2004.Google Scholar
- S. Pedroni and N. Rappin. Jython Essentials. O'Reilly Media, Inc., 2002.Google Scholar
- S. L. Peyton Jones and A. L. M. Santos. A transformation-based optimiser for Haskell. Science of Computer Programming, 32(1-3):3--47, September 1998. Google Scholar
- K. Seymour and J. Dongarra. Automatic translation of Fortran to JVM bytecode. In Joint ACM Java Grande -- ISCOPE 2001 Conference, Stanford University, California, June 2-4, 2001, New York, NY 10036, USA, 2001. ACM. Google Scholar
- Y. Smaragdakis and D. Batory. Mixin layers: an object-oriented implementation technique for refinements and collaboration-based designs. ACM Transactions on Software Engineering and Methodology (TOSEM), 11(2):215--255, 2002. Google Scholar
- G. Steele. Growing a language. Higher-Order and Symbolic Compututation, 12(3):221--236, October 1999. Google Scholar
- Sun Microsystems. The annotation processing tool (apt). http://java.sun.com/j2se/1.5.0/docs/guide/apt.Google Scholar
- M. Tatsubori, S. Chiba, K. Itano, and M.-O. Killijian. OpenJava: A class-based macro system for Java. In W. Cazzola, R. J. Stroud, and F. Tisato, editors, First OOPSLA Workshop on Reflection and Software Engineering (OORaSE'99), volume 1826 of Lecture Notes in Computer Science, pages 117--133. Springer, Nov. 1999. Google Scholar
- The XDoclet team. XDoclet: attribute-oriented programming. http://xdoclet.sourceforge.net/Google Scholar
- A. Tolmach. An external representation for the GHC core language. http://haskell.org/ghc/docs/papers/core.ps.gz, September 2001.Google Scholar
- R. Vallée-Rai, P. Co, E. Gagnon, L. Hendren, P. Lam, and V. Sundaresan. Soot - a Java bytecode optimization framework. In CASCON '99: Proceedings of the 1999 conference of the Centre for Advanced Studies on Collaborative research, page 13. IBM, 1999. Google Scholar
- A. van Deursen, P. Klint, and F. Tip. Origin tracking. Journal of Symbolic Computation, 15(5/6):523--545, 1993. Google Scholar
- E. VanWyk, O. de Moor, K. Backhouse, and P. Kwiatkowski. Forwarding in attribute grammars for modular language design. In R. N. Horspool, editor, Proceedings of the 11th International Conference on Compiler Construction (CC'02), volume 2304 of Lecture Notes on Computer Science, pages 128--142, London, UK, 2002. Springer-Verlag. Google Scholar
- E. Van Wyk, L. Krishnan, A. Schwerdfeger, and D. Bodin. Attribute grammar-based language extensions for Java. In E. Ernst, editor, European Conference on Object Oriented Programming (ECOOP'07), volume 4609 of Lecture Notes on Computer Science, pages 575--599. Springer Verslag, July 2007. Google Scholar
- E. Visser. Meta-programming with concrete object syntax. In D. Batory, C. Consel, and W. Taha, editors, Generative Programming and Component Engineering (GPCE 2002), volume 2487 of Lecture Notes in Computer Science, pages 299--315, Pittsburgh, PA, USA, October 2002. Springer-Verlag. Google Scholar
- J. Warmer and A. Kleppe. Building a flexible software factory using partial domain specific models. In J. Gray, J.-P. Tolvanen, and J. Sprinkle, editors, Proceedings of the 6th OOPSLA Workshop on Domain-Specific Modeling (DSM 2006), volume TR-37 of Computer Science and Information System Reports, pages 15-22, Finland, October 2006. University of Jyväskylä.Google Scholar
Index Terms
- Mixing source and bytecode: a case for compilation by normalization
Recommendations
Mixing source and bytecode: a case for compilation by normalization
Language extensions increase programmer productivity by providing concise, often domain-specific syntax, and support for static verification of correctness, security, and style constraints. Language extensions can often be realized through translation ...
Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions
OOPSLA '04Application programmer's interfaces give access to domain knowledge encapsulated in class libraries without providing the appropriate notation for expressing domain composition. Since object-oriented languages are designed for extensibility and reuse, ...
Concrete syntax for objects: domain-specific language embedding and assimilation without restrictions
OOPSLA '04: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applicationsApplication programmer's interfaces give access to domain knowledge encapsulated in class libraries without providing the appropriate notation for expressing domain composition. Since object-oriented languages are designed for extensibility and reuse, ...
Comments