We present a lightweight type-and-effect system for Java pro-grams that features two major innovations over extant object-orientedeffects systems: initialization effects, which are writes to an object's statewhile it is being constructed, and quiescing fields, which are fields thatare never written after an object is constructed. We also present a noveltaxonomy of degrees of method purity in object-oriented programs, whichcharacterizes methods whose effects are confined to their receiver object.Finally, we find significant amounts of mostly-functional behavior in re-alistic Java programs: in the benchmarks we analyzed, between 48-53%of declared fields were identifiable as quiescing and between 24-78% ofdynamic field reads were from quiescing fields.
展开▼