ABSTRACT
X10 is a modern object-oriented language designed for productivity and performance in concurrent and distributed systems. In this setting, dependent types offer significant opportunities for detecting design errors statically, documenting design decisions, eliminating costly run-time checks (e.g., for array bounds, null values), and improving the quality of generated code.
We present the design and implementation of constrained types, a natural, simple, clean, and expressive extension to object-oriented programming: A type C{c} names a class or interface C and a constraint c on the immutable state of C and in-scope final variables. Constraints may also be associated with class definitions (representing class invariants) and with method and constructor definitions (representing preconditions). Dynamic casting is permitted. The system is parametric on the underlying constraint system: the compiler supports a simple equality-based constraint system but, in addition, supports extension with new constraint systems using compiler plugins.
- Alexander Aiken, Edward L. Wimmers, and T. K. Lakshman. Soft typing with conditional types. In Proceedings of the 21st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 163--173, January 1994. Google Scholar
Digital Library
- Hassan Ait-Kaci. A lattice theoretic approach to computation based on a calculus of partially ordered type structures (property inheritance, semantic nets, graph unification). PhD thesis, University of Pennsylvania, 1984. Google Scholar
Digital Library
- Thorsten Altenkirch, Conor McBride, and James McKinna. Why dependent types matter. http://www.e-pig.org/downloads/ydtm.pdf, April 2005.Google Scholar
- Chris Andreae, James Noble, Shane Markstrum, and Todd Millstein. A framework for implementing pluggable type systems. In Proceedings of the 2006 ACM Conference on Object Oriented Programming Systems, Languages, and Applications (OOPSLA), October 2006. Google Scholar
Digital Library
- David Aspinall and Martin Hofmann. Dependent Types, chapter 2. In Pierce {52}, 2004.Google Scholar
- Lennart Augustsson. Cayenne: a language with dependent types. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP '98), pages 239--250, 1998. Google Scholar
Digital Library
- Clark Barrett and Sergey Berezin. CVC Lite: A new implementation of the cooperating validity checker. In Rajeev Alur and Doron A. Peled, editors, Proceedings of the $16^th$ International Conference on Computer Aided Verification (CAV '04), volume 3114 of Lecture Notes in Computer Science, pages 515--518. Springer-Verlag, July 2004. Boston, Massachusetts.Google Scholar
- Clark Barrett, Cesare Tinelli, Alexander Fuchs, Yeting Ge, George Hagen, and Dejan Jovanovic. CVC3. http://www.cs.nyu.edu/acsys/cvc3.Google Scholar
- Gilad Bracha. Pluggable type systems. In OOPSLA'04 Workshop on Revival of Dynamic Languages, October 2004.Google Scholar
- Bradford L. Chamberlain, Sung-Eun Choi, Steven J. Deitz, and Lawrence Snyder. The high-level parallel language ZPL improves productivity and performance. In Proceedings of the IEEE International Workshop on Productivity and Performance in High-End Computing, 2004.Google Scholar
- Craig Chambers. Predicate classes. In ECOOP '93 Conference Proceedings, 1993. Google Scholar
Digital Library
- Brian Chin, Shane Markstrum, and Todd Millstein. Semantic type qualifiers. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 85--95, 2005. Google Scholar
Digital Library
- Stephen Chong, Andrew C. Myers, K. Vikram, and Lantian Zheng. Jif reference manual, Jif 3.0.0 version. http://www.cs.cornell.edu/jif, June 2006.Google Scholar
- Dave Clarke, Sophia Drossopoulou, James Noble, and Tobias Wrigstad. Tribe: a simple virtual class calculus. In AOSD '07: Proceedings of the 6th international conference on Aspect-oriented software development, pages 121--134, New York, NY, USA, 2007. ACM Press. Google Scholar
Digital Library
- The Coq proof assistant: Reference manual, version 8.1. http://coq.inria.fr/, 2006.Google Scholar
- Thierry Coquand and Gerard Huet. The Calculus of Constructions. Information and Computation, 76, 1988. Google Scholar
Digital Library
- Erik Ernst. gbeta: A Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Department of Computer Science, University of Aarhus, Århus, Denmark, 1999.Google Scholar
- Erik Ernst, Klaus Ostermann, and William R. Cook. A virtual class calculus. In Proc. 33th ACM Symp. on Principles of Programming Languages (POPL), pages 270--282, Charleston, South Carolina, January 2006. Google Scholar
Digital Library
- Cormac Flanagan. Hybrid type checking. In Proceedings of the 33rd Annual Symposium on Principles of Programming Languages (POPL'06), pages 245--256, 2006. Google Scholar
Digital Library
- Cormac Flanagan, Stephen N. Freund, and Aaron Tomb. Hybrid types, invariants, and refinements for imperative objects. In International Workshop on Foundations of Object-Oriented Programming (FOOL), 2006.Google Scholar
- Cormac Flanagan, K. Rustan M. Leino, Mark Lillibridge, Greg Nelson, James B. Saxe, and Raymie Stata. Extended static checking for Java. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), June 2002. Google Scholar
Digital Library
- Seth Fogarty, Emir Pašalić, Jeremy Siek, and Walid Taha. Concoqtion: indexed types now! In Proceedings of the 2007 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation (PEPM), pages 112--121, January 2007. Google Scholar
Digital Library
- Jeffrey S. Foster, Tachio Terauchi, and Alex Aiken. Flow-sensitive type qualifiers. In Proc. 29th ACM Symp. on Principles of Programming Languages (POPL), pages 1--12. ACM Press, June 2002. Google Scholar
Digital Library
- Tim Freeman and Frank Pfenning. Refinement types for ML. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 268--277, June 1991. Google Scholar
Digital Library
- Vaidas Gasiunas, Mira Mezini, and Klaus Ostermann. Dependent classes. In OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications, pages 133--152. ACM, 2007. Google Scholar
Digital Library
- J. Gosling, W. Joy, G. Steele, and G. Bracha. The Java Language Specification, Third Edition. Addison Wesley, 2006. Google Scholar
Digital Library
- Christian Grothoff, Jens Palsberg, and Vijay Saraswat. Safe arrays via regions and dependent types. Technical Report RC23911, IBM T.J. Watson Research Center, 2006.Google Scholar
- John Hughes, Lars Pareto, and Amr Sabry. Proving the correctness of reactive systems using sized types. In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 410--423, 1996. Google Scholar
Digital Library
- A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. In ACM Symposium on Object-Oriented Programming: Systems, Languages and Applications, 1999. Google Scholar
Digital Library
- J. Jaffar and J.-L. Lassez. Constraint Logic Programming. In Proceedings of the 14th Annual ACM Symposium on Principles of Programming Languages (POPL'87), pages 111--119. ACM Press, New York (NY), USA, 1987. Google Scholar
Digital Library
- Radha Jagadeesan, Gopalan Nadathur, and Vijay A. Saraswat. Testing concurrent systems: An interpretation of intuitionistic logic. In Ramaswamy Ramanujam and Sandeep Sen, editors, FSTTCS, volume 3821 of Lecture Notes in Computer Science, pages 517--528. Springer, 2005. Google Scholar
Digital Library
- Mark P. Jones. Qualified Types: Theory and Practice. Cambridge University Press, 1994. Google Scholar
Digital Library
- JSR 308: Annotations on Java types. http://jcp.org/en/jsr/detail?id=308.Google Scholar
- Xavier Leroy et al. The Objective Caml system. http://caml.inria.fr/ocaml/.Google Scholar
- O. Lehrmann Madsen, B. Møller-Pedersen, and K. Nygaard. Object Oriented Programming in the BETA Programming Language. Addison-Wesley, June 1993. Google Scholar
Digital Library
- Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual classes: A powerful mechanism for object-oriented programming. In Proc. OOPSLA '89, pages 397--406, October 1989. Google Scholar
Digital Library
- Per Martin-Löf. A Theory of Types. 1971.Google Scholar
- Conor McBride and James McKinna. The view from the left. Journal of Functional Programming, 14(1):69--111, 2004. Google Scholar
Digital Library
- Todd Millstein. Practical predicate dispatch. In Proceedings of the 19th ACM Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), October 2004. Google Scholar
Digital Library
- John C. Mitchell. Coercion and type inference. In Proceedings of the 11th Annual ACM Symposium on Principles of Programming Languages (POPL'84), pages 174--185, 1984. Google Scholar
Digital Library
- Andrew C. Myers. JFlow: Practical mostly-static information flow control. In Proc. 26th ACM Symp. on Principles of Programming Languages (POPL), pages 228--241, San Antonio, TX, January 1999. Google Scholar
Digital Library
- G. Nelson and D. Oppen. Simplification by cooperating decision procedures. ACM Transactions on Programming Languages and Systems (TOPLAS), 1(2), October 1979. Google Scholar
Digital Library
- Flemming Nielson and Hanne Riis Nielson. Two-level functional languages. Cambridge University Press, 1992. Google Scholar
Digital Library
- Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for Java. In Görel Hedin, editor, Compiler Construction, 12th International Conference, CC 2003, number 2622 in LNCS, pages 138--152. Springer-Verlag, April 2003. Google Scholar
Digital Library
- Nathaniel Nystrom, Xin Qi, and Andrew C. Myers. J&: Nested intersection for scalable software extension. In Proceedings of the 2006 ACM Conference on Object Oriented Programming Systems, Languages, and Applications (OOPSLA '06), pages 21--36, Portland, OR, October 2006. Google Scholar
Digital Library
- Nathaniel Nystrom and Vijay Saraswat. An annotation and compiler plugin system for X10. Technical Report RC24198, IBM T.J. Watson Research Center, 2007.Google Scholar
- Martin Odersky. Report on the programming language Scala. Technical report, EPFL, 2006.Google Scholar
- Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Sebastian Maneth, Stéphane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. An overview of the Scala programming language, June 2004. http://scala.epfl.ch/docu/files/ScalaOverview.pdf.Google Scholar
- Martin Odersky, Vincent Cremet, Christine Röckl, and Matthias Zenger. A nominal theory of objects with dependent types. In Proceedings of 17th European Conference on Object-Oriented Programming (ECOOP 2003), number 2743 in Lecture Notes in Computer Science, pages 201--224. Springer-Verlag, July 2003.Google Scholar
Cross Ref
- Martin Odersky and Christoph Zenger. Nested types. In 8th Workshop on Foundations of Object-Oriented Languages (FOOL), 2001.Google Scholar
- Martin Odersky and Matthias Zenger. Scalable component abstractions. In Proc. OOPSLA '05, pages 41--57, San Diego, CA, USA, October 2005. Google Scholar
Digital Library
- Benjamin C. Pierce, editor. Advanced Topics in Types and Programming Languages. MIT Press, 2004. Google Scholar
Digital Library
- François Pottier. Simplifying subtyping constraints. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP '96), pages 122--133, 1996. Google Scholar
Digital Library
- W. H. Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling. Numerical Recipes in FORTRAN: The Art of Scientific Computing, pages 866--869. Cambridge University Press, 1992. Successive overrelaxation (SOR). Google Scholar
Digital Library
- John C. Reynolds. Three approaches to type structure. In Proceedings of TAPSOFT/CAAP 1985, volume 185 of LNCS, pages 97--138. Springer-Verlag, 1985. Google Scholar
Digital Library
- Patrick Rondon, Ming Kawaguchi, and Ranjit Jhala. Liquid types. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), June 2008. Google Scholar
Digital Library
- Vijay Saraswat. The category of constraint systems is Cartesian closed. In LICS '92, pages 341--345, 1992.Google Scholar
Cross Ref
- Vijay Saraswat et al. The X10 language specification. Technical report, IBM T.J. Watson Research Center, 2006.Google Scholar
- Martin Sulzmann, Martin Odersky, and Martin Wehr. Type inference with constrained types. In Fourth International Workshop on Foundations of Object-Oriented Programming (FOOL 4), 1997.Google Scholar
- Martin Sulzmann and Peter J. Stuckey. HM(X) type inference is CLP(X) solving. Journal of Functional Programming, 18(2):251--283, 2008. Google Scholar
Digital Library
- Walid Taha and Tim Sheard. Multi-stage programming with explicit annotations. In ACM/SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pages 203--217, 1997. Google Scholar
Digital Library
- Valery Trifonov and Scott Smith. Subtyping constrained types. In Third International Static Analysis Symposium (SAS), number 1145 in LNCS, pages 349--365, 1996. Google Scholar
Digital Library
- Hongwei Xi and Frank Pfenning. Eliminating array bound checking through dependent types. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 249--257, Montreal, Canada, June 1998. Google Scholar
Digital Library
- Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In Proceedings of the 26th Annual ACM Symposium on Principles of Programming Languages (POPL'99), pages 214--227, San Antonio, TX, January 1999. Google Scholar
Digital Library
Index Terms
Constrained types for object-oriented languages
Recommendations
Constrained types for object-oriented languages
X10 is a modern object-oriented language designed for productivity and performance in concurrent and distributed systems. In this setting, dependent types offer significant opportunities for detecting design errors statically, documenting design ...
A Practical Comparison of Two Object-Oriented Languages
The author compares two very different object-oriented programming languages, Flavors and C++, with respect to their merits and how design decisions in each language influence various aspects of programming. The fundamental difference between the two ...
Generalized algebraic data types and object-oriented programming
Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applicationsGeneralized algebraic data types (GADTs) have received much attention recently in the functional programming community. They generalize the (type) parameterized algebraic datatypes (PADTs) of ML and Haskell by permitting value constructors to return ...







Comments