skip to main content
article
Free Access

A provenly correct translation of Fickle into Java

Published:01 April 2007Publication History
Skip Abstract Section

Abstract

We present a translation from Fickle, a small object-oriented language allowing objects to change their class at runtime, into Java. The translation is provenly correct in the sense that it preserves the static and dynamic semantics. Moreover, it is compatible with separate compilation, since the translation of a Fickle class does not depend on the implementation of used classes. Based on the formal system, we have developed an implementation.

The translation turned out to be a more subtle problem than we expected. In this article, we discuss four possible approaches we considered for the design of the translation and to justify our choice, we present formally the translation and proof of preservation of the static and dynamic semantics, and discuss the prototype implementation. Moreover, we outline an alternative translation based on generics that avoids most of the casts (but not all) needed in the previous translation.

The language Fickle has undergone and is still undergoing several phases of development. In this article we are discussing the translation of FickleII.

References

  1. Ancona, D., Anderson, C., Damiani, F., Drossopoulou, S., Giannini, P., and Zucca, E. 2001. An effective translation of Fickle into Java (extended abstract). In Proceedings of the Italian Conference on Theoretical Computer Science. Lecture Notes in Computer Science, vol. 2202. Springer-Verleg 215--234. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Ancona, D., Anderson, C., Damiani, F., Drossopoulou, S., Giannini, P., and Zucca, E. 2002. A type preserving translation of Fickle into Java. In TOSCA'01. Electronic Notes on Theoretical Computer Science, vol. 62. Elsevier. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Ancona, D., Lagorio, G., and Zucca, E. 2003. Jam--Designing a Java extension with mixins. ACM Trans. Program. Lang. Syst. 25, 5 (Sept.), 641--712. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Anderson, C. 2001. Implementing Fickle. Thesis, Imperial College.Google ScholarGoogle Scholar
  5. Anderson, C. 2003. Isabella-Fickle translator. http://www.macs.hw.ac.uk/DART/software/isabella/index.html.Google ScholarGoogle Scholar
  6. Boyland, J. and Castagna, G. 1997. Parasitic methods: An implementation of multi-methods for Java. In Proceedings of the ACM Symposium on Object-Oriented Programming: Systems, Languages and Applications. ACM Press, New York. 66--76. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bracha, G., Odersky, M., Stoutmire, D., and Wadler, P. 1998. Making the future safe for the past: Adding genericity to the Java programming language. In Proceedings of the ACM Symposium on Object-Oriented Programming: Systems, Languages and Applications. ACM Press, New York. 183--200. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Chambers, C. 1993. Predicate classes. In Proceedings of the ECOOP---European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, vol. 707. Springer Verlag. 268--296. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Clifton, C., Millstein, T., Leavens, G. T., and Chambers, C. 2006. MultiJava: Design rationale, compiler implementation, and applications. ACM Trans. Program. Lang. Syst. 28, 3, 517--575. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Costanza, P. 2001. Dynamic object replacement and implementation-only classes. In WCOP'01 (at ECOOP'01). http://www.cs.uni-bonn.de/~costanza/implementationonly.pdf.Google ScholarGoogle Scholar
  11. Damiani, F., Dezani-Ciancaglini, M., and Giannini, P. 2004. Re-Classification and multithreading: FickleMT. In OOPS track at SAC, vol. 2. ACM Press, New York, 1297--1304. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Drossopoulou, S., Damiani, F., Dezani-Ciancaglini, M., and Giannini, P. 2001. Fickle: Dynamic object re-classification. In Proceedings of the ECOOP---European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, vol. 2072. Springer Verlag, 130--149. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Drossopoulou, S., Damiani, F., Dezani-Ciancaglini, M., and Giannini, P. 2002. More dynamic object re-classification: FickleII. ACM Trans. Program. Lang. Syst. 24, 2, 153--191. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Ernst, M. D., Kaplan, C., and Chambers, C. 1998. Predicate dispatching: A unified theory of dispatch. In Proceedings of the ECOOP - European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, vol. 1445. Springer Verlag, 186--211. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Gamma, E., Helm, R., Johnson, R., and Vlissides, J. 1995. Design Patterns: Elements od Reusable Object-Oriented Software. Professional Computing Series. Addison-Wesley. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Hürsch, W. 1994. Should superclasses be abstract? In Proceedings of the ECOOP---European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, vol. 821. Springer Verlag, 12--31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Igarashi, A. and Pierce, B. C. 2002. On inner classes. Inf. Comput. 177, 1 (Aug.), 56--89. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Joy, B., Gosling, J., Steele, G., and Bracha, G. 2005. The Java Language Specification, 3rd ed. Addison-Wesley. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. McDirmid, S., Flatt, M., and Hsieh, W. 2001. Jiazzi: New age components for old fashioned Java. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA). ACM Press, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Odersky, M. and Wadler, P. 1997. Pizza into Java: Translating theory into practice. In Proceedings of the ACM Symposium on Principles of Programming Languages. ACM Press, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Pierce, B. C. 2002. Types and Programming Languages. MIT Press, Cambridge, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Serrano, M. 1999. Wide classes. In Proceedings of the ECOOP---European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, vol. 1628, Springer Verlag, 391--415.Google ScholarGoogle Scholar
  23. Taivalsaari, A. 1993. Object oriented programming with modes. J. Obj. Oriented Program. 6, 3, 27--32.Google ScholarGoogle Scholar

Index Terms

  1. A provenly correct translation of Fickle into Java

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in

                Full Access

                • Published in

                  cover image ACM Transactions on Programming Languages and Systems
                  ACM Transactions on Programming Languages and Systems  Volume 29, Issue 2
                  April 2007
                  327 pages
                  ISSN:0164-0925
                  EISSN:1558-4593
                  DOI:10.1145/1216374
                  Issue’s Table of Contents

                  Copyright © 2007 ACM

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 1 April 2007
                  Published in toplas Volume 29, Issue 2

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • article

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader
                About Cookies On This Site

                We use cookies to ensure that we give you the best experience on our website.

                Learn more

                Got it!