Constrained Types for Object-Oriented Languages

被引:0
作者
Nystrom, Nathaniel [1 ]
Saraswat, Vijay [1 ]
Palsberg, Jens [2 ]
Grothoff, Christian [3 ]
机构
[1] IBM Corp, Thomas J Watson Res Ctr, POB 704, Yorktown Hts, NY 10598 USA
[2] Univ Calif Los Angeles, Dept Comp Sci, Los Angeles, CA 90095 USA
[3] Univ Denver, Dept Comp Sci, Denver, CO 80208 USA
来源
OOPSLA 2008 NASHVILLE, CONFERENCE PROCEEDINGS: MUSIC CITY USA, OOPSLA | 2008年
关键词
Languages;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
X10 is a modem 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.
引用
收藏
页码:457 / +
页数:5
相关论文
共 63 条
  • [1] AIKEN A, 1994, P S PRINC PROGR LANG, P163, DOI DOI 10.1145/174675.177847
  • [2] Ait-Kaci H., 1984, A Lattice Theoretic Approach to Computation Based on a Calculus of Partially Ordered Type Structures
  • [3] ALTENKIRCH T, 2005, WHY DEPENDENT TYPES
  • [4] [Anonymous], 1998, PROC 3 ACM SIGPLAN I, DOI DOI 10.1145/289423.289451
  • [5] [Anonymous], The coq proof assistant
  • [6] Barrett C, 2004, LECT NOTES COMPUT SC, V3114, P515
  • [7] Bracha G., 2004, OOPSLA 04 WORKSH REV
  • [8] Flanagan C., 2002, P ACM SIGPLAN C PROG
  • [9] FLANAGAN C, 2006, POPL, P245
  • [10] FOGARTY S, 2007, PEPM, P112