Nothing Special   »   [go: up one dir, main page]

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

Establishing object invariants with delayed types

Published: 21 October 2007 Publication History

Abstract

Mainstream object-oriented languages such as C# and Java provide an initialization model for objects that does not guarantee programmer controlled initialization of fields. Instead, all fields are initialized to default values (0 for scalars and null for non-scalars) on allocation. This is in stark contrast to functional languages, where all parts of an allocation are initialized to programmer-provided values. These choices have a direct impact on two main issues: 1) the prevalence of null in object oriented languages (and its general absence in functional languages), and 2) the ability to initialize circular data structures. This paper explores connections between these differing approaches and proposes a fresh look at initialization. Delayed types are introduced to express and formalize prevalent initialization patterns in object-oriented languages.

References

[1]
Mike Barnett, K. Rustan, M. Leino, and Wolfram Schulte. The Spec# Programming System: an Overview. In Proceedings of the Workshop on Construction and Analysis of Safe, Secure and Interoperable Smart devices, volume 3362 of LNCS, 2004.
[2]
P. Chalin and P. James. Non-null References by Default in Java: Alleviating the Nullity Annotation Burden. In Proceedings of the 21st European Conference on Object-Oriented Programming, 2007.
[3]
Derek Dreyer, Robert Harper, and Karl Crary. A Type System for Well--Founded Recursion. In Proceedings of the 31st Annual ACM SIGPLAN--SIGACT Symposium on Principles of Programming Languages, 2004.
[4]
Manuel Fähndrich and K. Rustan M. Leino. Declaring and Checking Non-Null Types in an Object-Oriented Language. In Proceedings of the 2003 ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2003, pages 302--312. ACM, November 2003.
[5]
Manuel Fåhndrich and K. Rustan M. Leino. Heap Monotonic Typestate. In Proceedings of the first International Workshop on Alias Confinement and Ownership (IWACO), July 2003.
[6]
Dan Grossman, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling Wang, and James Cheney. Region-based Memory Management in Cyclone. In Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 282--293. ACM, May 2002.
[7]
Gary T. Leavens, Albert L. Baker, and Clyde Ruby. JML: A notation for detailed design. In HaimKilov, Bernhard Rumpe, and Ian Simmonds, editors, Behavioral Specifications of Businesses and Systems, pages 175--188. Kluwer Academic Publishers, 1999.
[8]
The OCaml Programming Language. http://caml.inria.fr.
[9]
Claudio Russo. Recursive Structures for Standard ML. In Proceedings of the 2001 International Conference on Functional Programming, pages 50--61, 2001.
[10]
Frederick Smith, David Walker, and Greg Morrisett. Alias types. In Proceedings of the 14th European Symposium on Programming, volume 1782 of LNCS, pages 366--381. Springer, March 2000.
[11]
Don Syme. An Alternative Approach to Initializing Mutually Referential Objects. Technical Report MSR-TR-2005-31, Microsoft Research, March 2005.
[12]
Mads Tofte and Jean-Pierre Talpin. Implementation of the Typed Call-by--Value lambda-Calculus using a Stack of Regions. In Proceedings of the 1994 Symposium on Principles of Programming Languages, pages 188--201, 1994.
[13]
David Walker and Greg Morrisett. Alias types for recursive data structures. In Proceedings of the 4th Workshop on Types in Compilation, September 2000.

Cited By

View all
  • (2024)Reference Counting Deeply Immutable Data Structures with Cycles: An Intellectual AbstractProceedings of the 2024 ACM SIGPLAN International Symposium on Memory Management10.1145/3652024.3665507(131-141)Online publication date: 20-Jun-2024
  • (2023)Toward Programming Languages for Reasoning: Humans, Symbolic Systems, and AI AgentsProceedings of the 2023 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3622758.3622895(136-152)Online publication date: 18-Oct-2023
  • (2022)A conceptual framework for safe object initialization: a principled and mechanized soundness proof of the Celsius modelProceedings of the ACM on Programming Languages10.1145/35633146:OOPSLA2(729-757)Online publication date: 31-Oct-2022
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applications
October 2007
728 pages
ISBN:9781595937865
DOI:10.1145/1297027
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 42, Issue 10
    Proceedings of the 2007 OOPSLA conference
    October 2007
    686 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1297105
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 October 2007

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. initialization
  2. non-null types
  3. object invariants

Qualifiers

  • Article

Conference

OOPSLA07
Sponsor:

Acceptance Rates

OOPSLA '07 Paper Acceptance Rate 33 of 156 submissions, 21%;
Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)0
Reflects downloads up to 24 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Reference Counting Deeply Immutable Data Structures with Cycles: An Intellectual AbstractProceedings of the 2024 ACM SIGPLAN International Symposium on Memory Management10.1145/3652024.3665507(131-141)Online publication date: 20-Jun-2024
  • (2023)Toward Programming Languages for Reasoning: Humans, Symbolic Systems, and AI AgentsProceedings of the 2023 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3622758.3622895(136-152)Online publication date: 18-Oct-2023
  • (2022)A conceptual framework for safe object initialization: a principled and mechanized soundness proof of the Celsius modelProceedings of the ACM on Programming Languages10.1145/35633146:OOPSLA2(729-757)Online publication date: 31-Oct-2022
  • (2022)Wildcards need witness protectionProceedings of the ACM on Programming Languages10.1145/35633016:OOPSLA2(373-394)Online publication date: 31-Oct-2022
  • (2020)ιDOT: a DOT calculus with object initializationProceedings of the ACM on Programming Languages10.1145/34282764:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2020)A type-and-effect system for object initializationProceedings of the ACM on Programming Languages10.1145/34282434:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2019)NullAway: practical type-based null safety for JavaProceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3338906.3338919(740-750)Online publication date: 12-Aug-2019
  • (2018)κDOT: scaling DOT with mutation and constructorsProceedings of the 9th ACM SIGPLAN International Symposium on Scala10.1145/3241653.3241659(40-50)Online publication date: 17-Sep-2018
  • (2017)Granullar: gradual nullable types for JavaProceedings of the 26th International Conference on Compiler Construction10.1145/3033019.3033032(87-97)Online publication date: 5-Feb-2017
  • (2017)Detecting Full Initialization Points of Objects to Support Code Refactorings2017 24th Asia-Pacific Software Engineering Conference (APSEC)10.1109/APSEC.2017.17(110-119)Online publication date: Dec-2017
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media