skip to main content
10.1145/1167473.1167500acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Generic ownership for generic Java

Published:16 October 2006Publication History

ABSTRACT

Ownership types enforce encapsulation in object-oriented programs by ensuring that objects cannot be leaked beyond object(s) that own them. Existing ownership programming languages either do not support parametric polymorphism (type genericity) or attempt to add it on top of ownership restrictions. Generic Ownership provides per-object ownership on top of a sound generic imperative language. The resulting system not only provides ownership guarantees comparable to established systems, but also requires few additional language mechanisms due to full reuse of parametric polymorphism. We formalise the core of Generic Ownership, highlighting that only restriction of this calls and owner subtype preservation are required to achieve deep ownership. Finally we describe how Ownership Generic Java (OGJ) was implemented as a minimal extension to Generic Java in the hope of bringing ownership types into mainstream programming.

References

  1. Abadi, M., and Cardelli, L. A Theory of Objects. Springer-Verlag, Berlin, Heidelberg, Germany, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Aldrich, J., and Chambers, C. Ownership Domains: Separating Aliasing Policy from Mechanism. In Proceedings of European Conference on Object-Oriented Programming (ECOOP) (Oslo, Norway, June 2004), vol. 3086, Springer-Verlag, Berlin, Heidelberg, Germany, pp. 1--25.Google ScholarGoogle ScholarCross RefCross Ref
  3. Aldrich, J., Kostadinov, V., and Chambers, C. Alias Annotations for Program Understanding. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Seattle, WA, USA, Nov. 2002), ACM Press, New York, NY, USA, pp. 311--330. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Andreae, C., Noble, J., Markstrum, S., and Millstein, T. A framework for implementing pluggable type systems. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Portland, Oregon, USA, Oct. 2006), ACM Press, New York, NY, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Baker, H. G. Unify and Conquer (Garbage, Updating, Aliasing) in Functional Languages. In Proc. 1990 ACM Conf. on Lisp and Functional Programming (Nice, France, June 1990), pp. 218--226. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Barnett, M., DeLine, R., Fahndrich, M., Leino, K. R. M., and Schulte, W. Verification of object-oriented programs with invariants. In Proceedings of the Workshop on Formal Techniques for Java-like Programs in European Conference on Object-Oriented Programming (FTfJP) (Darmstadt, Germany, July 2003), Springer-Verlag, Berlin, Heidelberg, Germany.Google ScholarGoogle Scholar
  7. Boyapati, C. SafeJava: A Unified Type System for Safe Programming. PhD thesis, EECS, MIT, February 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Boyapati, C., Lee, R., and Rinard, M. Ownership types for safe programming: Preventing data races and deadlocks. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (November 2002). Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Boyapati, C., Lee, R., and Rinard, M. Safe runtime downcasts with ownership types. In Proceedings of International Workshop on Aliasing, Confinement, and Ownership (IWACO), D. Clarke, Ed. Utrecht University, July 2003, pp. 1--14.Google ScholarGoogle Scholar
  10. Boyapati, C., Liskov, B., and Shrira, L. Ownership Types for Object Encapsulation. In Proceedings of ACM Symposium on Principles of Programming Languages (POPL) (New Orleans, LA, USA, Jan. 2003), ACM Press, New York, NY, USA, pp. 213--223. Invited talk by Barbara Liskov. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Boyapati, C., and Rinard, M. A Parameterized Type System for Race-Free Java Programs. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Tampa Bay, FL, USA, 2001), ACM Press, New York, NY, USA, pp. 56--69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Boyland, J. Checking interference with fractional permissions. In Static Analysis: 10th International Symposium (2003), no. 2694 in Lecture Notes in Computer Science (LNCS), Srringer-Verlag, Berlin, Heidelberg, Germany, pp. 55--72. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Boyland, J. T., and Reter, W. Connecting effects and uniqueness with adoption. In Proceedings of ACM Symposium on Principles of Programming Languages (POPL) (2005). Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Bracha, G., Odersky, M., Stoutamire, D., and Wadler, P. Making the future safe for the past: Adding Genericity to the Java programming language. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Oct. 1998). Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Charles, P., Donawa, C., Ebcioglu, K., Grothoff, C., Kielstra, A., Sarkar, V., and Praun, C. V. X10: An object-oriented approach to non-uniform cluster computing. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (2005). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Clarke, D. Object Ownership and Containment. PhD thesis, School of CSE, UNSW, Australia, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Clarke, D., and Drossopoulou, S. Ownership, Encapsulation, and the Disjointness of Type and Effect. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Seattle, WA, USA, Nov. 2002), ACM Press, New York, NY, USA, pp. 292--310. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Clarke, D., Potter, J., and Noble, J. Ownership Types for Flexible Alias Protection. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Vancouver, Canada, Oct. 1998), ACM Press, New York, NY, USA, pp. 48--64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Clarke, D., Richmond, M., and Noble, J. Saving the World from Bad Beans: Deployment-Time Confinement Checking. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Anaheim, CA, 2003), ACM Press, New York, NY, USA, pp. 374--387. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Clarke, D., and Wrigstad, T. External Uniqueness is Unique Enough. In Proceedings of European Conference on Object-Oriented Programming (ECOOP) (Darmstadt, Germany, July 2003), vol. 2473 of Lecture Notes in Computer Science (LNCS), Springer-Verlag, Berlin, Heidelberg, Germany, pp. 176--200.Google ScholarGoogle ScholarCross RefCross Ref
  21. Diwan, A., McKinley, K. S., and Moss, J. E. B. Type-based alias analysis. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (June 1998). Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Fluet, M., and Pucella, R. Phantom Types and Subtyping. In International Conference on Theoretical Computer Science (TCS) (Aug. 2002), pp. 448--460. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Grossman, D., Morrisett, J. G., Jim, T., Hicks, M. W., Wang, Y., and Cheney, J. Region-based memory management in cyclone. In PLDI (2002), pp. 282--293. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Grothoff, C., Palsberg, J., and Vitek, J. Encapsulating Objects with Confined Types. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Tampa Bay, FL, USA, 2001), ACM Press, New York, NY, USA, pp. 241--255. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Hogg, J. Islands: Aliasing Protection in Object-Oriented Languages. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (Phoenix, AZ, USA, Nov. 1991), vol. 26, ACM Press, New York, NY, USA, pp. 271--285. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Hogg, J., Lea, D., Wills, A., de Champeaux, D., and Holt, R. The Geneva convention of the treatment of object aliasing. OOPS Messenger 3, 2 (April 1992), 11--16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Igarashi, A., Pierce, B. C., and Wadler, P. Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems (TOPLAS) 23, 3 (May 2001), 396--450. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Igarashi, A., Pierce, B. C., and Wadler, P. A recipe for raw types. In Proceedings of Workshop on Foundations of Object-Oriented Languages (FOOL) (2001).Google ScholarGoogle Scholar
  29. Kennedy, A., and Russo, C. Generalized algebraic data types and object-oriented programming. In Proceedings of ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) (2005). Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Kennedy, A., and Syme, D. The design and implementation of Generics for the .NET Common Language Runtime. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (2001). Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Krishnaswami, N., and Aldrich, J. Permission-based ownership: Encapsulating state in higher-order typed languages. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (Chicago, UL, USA, 2005), ACM Press, New York, NY, USA, pp. 96--106. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Lamport, L., and Schneider, F. B. Constraints: A uniform approach to aliasing and typing. In Proceedings of ACM Symposium on Principles of Programming Languages (POPL) (New Orleans, Louisiana, 1985), pp. 205--216. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Leino, K. R. M., and Muller, P. Object invariants in dynamic contexts. In Proceedings of European Conference on Object-Oriented Programming (ECOOP) (2004), Springer-Verlag, Berlin, Heidelberg, Germany.Google ScholarGoogle ScholarCross RefCross Ref
  34. Lu, Y., and Potter, J. A type system for reachability and acyclicity. In Proceedings of European Conference on Object-Oriented Programming (ECOOP) (2005), vol. 3586 of Lecture Notes in Computer Science, Springer, pp. 479--503. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Lu, Y., and Potter, J. Flexible ownership types with owner variance. In Proceedings of European Conference on Object-Oriented Programming (ECOOP) (2006).Google ScholarGoogle Scholar
  36. Lu, Y., and Potter, J. Protecting representation with effect encapsulation. In Proceedings of ACM Symposium on Principles of Programming Languages (POPL) (2006). Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Milner, R. Theory of type polymorphism in programming. Journal of Computer and System Sciences 17(3) (1978), 348--375.Google ScholarGoogle ScholarCross RefCross Ref
  38. Mitchell, N. The runtime structure of object ownership. In Proceedings of European Conference on Object-Oriented Programming (ECOOP) (Nantes, France, July 2006), D. Thomas, Ed., vol. 4067 of Lecture Notes in Computer Science (LNCS), Springer-Verlag, Berlin, Heidelberg, Germany, pp. 74--98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Müller, P., and Poetzsch-Heffter, A. Programming Languages and Fundamentals of Programming. Fernuniversität Hagen, 1999, ch. Universes: a Type System for Controlling Representation Exposure. Poetzsch-Heffter, A. and Meyer, J. (editors).Google ScholarGoogle Scholar
  40. Noble, J., Vitek, J., and Potter, J. Flexible Alias Protection. In Proceedings of European Conference on Object-Oriented Programming (ECOOP) (July 1998), E. Jul, Ed., vol. 1445 of Lecture Notes in Computer Science (LNCS), Springer-Verlag, Berlin, Heidelberg, Germany, pp. 158--185. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. O'Callahan, R., and Jackson, D. Lackwit: a program understanding tool based on type inference. In Proceedings of the International Conference on Software Engineering (ICSE) (Boston, USA, May 1997). Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Permandla, P., and Boyapati, C. A type system for preventing data races and deadlocks in the java virtual machine language. Tech. rep., University of Michigan, 2005.Google ScholarGoogle Scholar
  43. Pierce, B. C. Types and Programming Languages. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Potanin, A. Ownership Generic Java Download. http://www.mcs.vuw.ac.nz/~ alex/ogj/, 2005.Google ScholarGoogle Scholar
  45. Potanin, A., Noble, J., Clarke, D., and Biddle, R. Defaulting Generic Java to Ownership. In Proceedings of the Workshop on Formal Techniques for Java-like Programs in European Conference on Object-Oriented Programming (FTfJP) (Oslo, Norway, June 2004), Springer-Verlag, Berlin, Heidelberg, Germany.Google ScholarGoogle Scholar
  46. Potanin, A., Noble, J., Clarke, D., and Biddle, R. Featherweight Generic Ownership. In Proceedings of the Workshop on Formal Techniques for Java-like Programs in European Conference on Object-Oriented Programming (FTfJP) (Glasgow, Scotland, July 2005), Springer-Verlag, Berlin, Heidelberg, Germany.Google ScholarGoogle Scholar
  47. Potanin, A., Noble, J., Clarke, D., and Biddle, R. Featherweight Generic Confinement. Journal of Functional Programming (2006). Accepted for publication. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Potanin, A., Noble, J., Clarke, D., and Biddle, R. Featherweight generic ownership. Tech. rep., Victoria University of Wellington, 2006. http://www.mcs.vuw.ac.nz/~alex/FGOTR.pdf.Google ScholarGoogle Scholar
  49. Pugh, B. Find Bugs - A Bug Pattern Detector for Java. www.cs.umd.edu/~pugh/jva/bugs/, 2003.Google ScholarGoogle Scholar
  50. Sun Microsystems. Java Development Kit. Available at: http://java.sun.com/j2se/, 2005.Google ScholarGoogle Scholar
  51. Talpin, J.-P., and Jouvelot, P. Polymorphic type, region, and effect inference. Journal of Functional Programming 2, 3 (July 1992), 245--271.Google ScholarGoogle ScholarCross RefCross Ref
  52. Tofte, M., and Talpin, J.-P. Region-Based Memory Management. Information and Computation 132, 2 (1997), 109--176. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Torgerson, M., Ernst, E., Hansen, C. P., von der Ahé, P., Bracha, G., and Gafter, N. Adding wildcards to the Java programming language. Journal of Object Technology 3, 11 (Dec. 2004), 97--116. Special Issue: OOPS track at SAC 2004.Google ScholarGoogle ScholarCross RefCross Ref
  54. Vitek, J., and Bokowski, B. Confined Types in Java. Software Practice & Experience 31, 6 (May 2001), 507--532. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Zhao, T., Palsberg, J., and Vitek, J. Type-Based Confinement. Journal of Functional Programming 16, 1 (2006), 83--128. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Generic ownership for generic 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

        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!