Object initialization in x10

  • Authors:
  • Yoav Zibin;David Cunningham;Igor Peshansky;Vijay Saraswat

  • Affiliations:
  • Google (work done at IBM);IBM research in TJ Watson;Google (work done at IBM);IBM research in TJ Watson

  • Venue:
  • ECOOP'12 Proceedings of the 26th European conference on Object-Oriented Programming
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

X10 is an object oriented programming language with a sophisticated type system (constraints, class invariants, non-erased generics, closures) and concurrency constructs (asynchronous activities, multiple places). Object initialization is a cross-cutting concern that interacts with all of these features in delicate ways that may cause type, runtime, and security errors. This paper discusses possible designs for object initialization, and the "hardhat" design chosen and implemented in X10 version 2.2. Our implementation includes a fixed-point inter-procedural (intra-class) data-flow analysis that infers, for each method called during initialization, the set of fields that are read, and those that are asynchronously and synchronously assigned. Our codebase of more than 200K lines of code only had 104 annotations. Finally, we formalize the essence of initialization checking with an effect system intended to complement a standard FJ style formalization of the type system for X10. This system is substantially simpler than the masked types of [10], and it is more practical (for X10) than the free-committed types of [12]. This is the first formalization of a type and (flow-sensitive) effect system for safe initialization in the presence of concurrency constructs.