Abstract

This paper presents Welterweight Java (WJ), a new minimal core Java calculus intended to be a suitable starting point for investigations in the semantics of Java-like programs. To this end, WJ adds a few extra pounds to Featherweight Java. WJ is imperative and stateful, which is a frequent extension of Featherweight Java. To account for the importance of concurrency, WJ models Java’s thread-based concurrency and lock-based synchronisation. The design of WJ is distilled from recent work on concurrent Java-like systems. We believe that the calculus is a good starting point for extensions. We illustrate the potential of the calculus by showing two extensions. The first is a version of WJ extended with deep ownership. This serves two purposes—it is a minimal formalisation of ownership, interesting in its own right, and shows how easily WJ can be extended. The second is a simple non-null types system.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Ahern, A., Yoshida, N.: Formalising Java RMI with Explicit Code Mobility. In: Proceedings of OOPSLA, pp. 403–422 (2005)Google Scholar
  2. 2.
    Bierman, G.M., Parkinson, M.J., Pitts, A.M.: MJ: An imperative core calculus for Java and Java with effects. Technical report, University of Cambridge (2003)Google Scholar
  3. 3.
    Clarke, D., Wrigstad, T.: External Uniqueness is Unique Enough. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 59–67. Springer, Heidelberg (2003)Google Scholar
  4. 4.
    Clarke, D.: Object Ownership and Containment. PhD thesis, School of Computer Science and Engineering, University of New South Wales, Sydney, Australia (2001)Google Scholar
  5. 5.
    Clarke, D., Drossopolou, S.: Ownership, encapsulation and the disjointness of type and effect. In: Proceedings of OOPSLA (November 2002)Google Scholar
  6. 6.
    Clifton, C., Leavens, G.T.: MiniMAO1: Investigating the semantics of proceed. Science of Computer Programming 63(3), 321–374 (2006)MATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Cunningham, D., Drossopoulou, S., Eisenbach, S.: Universes for race safety. In: VAMP ’07, September 2007, pp. 20–51 (2007)Google Scholar
  8. 8.
    Dietl, W., Drossopoulou, S., Müller, P.: Generic universe types. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 28–53. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  9. 9.
    Dietl, W., Müller, P.: Universes: Lightweight Ownership for JML. Journal of Object Technology 4(8), 5–32 (2002)Google Scholar
  10. 10.
    Fähndrich, M., Rustan, K., Leino, M.: Declaring and checking non-null types in an object-oriented language. In: Proceedings of OOPSLA, pp. 302–312. ACM, New York (2003)Google Scholar
  11. 11.
    Fähndrich, M., Xia, S.: Establishing object invariants with delayed types. SIGPLAN Not. 42(10), 337–350 (2007)CrossRefGoogle Scholar
  12. 12.
    Flatt, M., Krishnamurthi, S., Felleisen, M.: A programmer’s reduction semantics for classes and mixins. In: Alves-Foss, J. (ed.) Formal Syntax and Semantics of Java. LNCS, vol. 1523, p. 241. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  13. 13.
    Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM TOPLAS 23(3), 396–450 (2001)CrossRefGoogle Scholar
  14. 14.
    Malayeri, D., Aldrich, J.: Cz: multiple inheritance without diamonds. In: Proceedings of OOPSLA, pp. 21–40. ACM, New York (2009)Google Scholar
  15. 15.
    Östlund, J., Wrigstad, T.: Welterweight Java website (2009), http://user.it.uu.se/~johos902
  16. 16.
    Östlund, J., Wrigstad, T., Clarke, D., Åkerblom, B.: Ownership, Uniqueness, and Immutability. In: Objects, Components, Models and Patterns (Proceedings of 46th International Conference on Objects, Models, Components, Patterns). Lecture Notes in Business Information Processing, vol. 11, pp. 178–197. Springer, Heidelberg (2008)Google Scholar
  17. 17.
    Parkinson, M., Strniša, R.: Lightweight Java web pages (2008–2009), http://www.cl.cam.ac.uk/research/pls/javasem/lj/
  18. 18.
    Qi, X., Myers, A.C.: Masked types for sound object initialization. SIGPLAN Not. 44(1), 53–65 (2009)CrossRefGoogle Scholar
  19. 19.
    Sewell, P., Nardelli, F.Z.: Ott Website (2010), http://www.cl.cam.ac.uk/~pes20/ott/
  20. 20.
    van Dooren, M., Joosen, W.: A modular type system for first-class composition inheritance. Technical Report Report CW 534, Department of Computer Science, K.U.Leuven (January 2009)Google Scholar
  21. 21.
    Vaziri, M., Tip, F., Dolby, J., Hammer, C., Vitek, J.: A type system for data-centric synchronization. To appear at ECOOP 2010 (2010)Google Scholar
  22. 22.
    Wrigstad, T., Clarke, D.: Existential owners for ownership types. Journal of Object Technology 6(4) (May/June 2007)Google Scholar
  23. 23.
    Wrigstad, T., Pizlo, F., Meawad, F., Zhao, L., Vitek, J.: Loci: Simple thread-locality for java. In: Drossopoulou, S. (ed.) ECOOP 2009 – Object-Oriented Programming. LNCS, vol. 5653, pp. 445–469. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  24. 24.
    Wrigstad, T., Nardelli, F.Z., Lebresne, S., Östlund, J., Vitek, J.: Integrating typed and untyped code in a scripting language. In: POPL ’10, pp. 377–388. ACM, New York (2010)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Johan Östlund
    • 1
  • Tobias Wrigstad
    • 1
  1. 1.Uppsala University 

Personalised recommendations