The Billion-Dollar Fix: Safe Modular Circular Initialisation with Placeholders and Placeholder Types

Marco Servetto, Julian Mackay, Alex Potanin, James Noble

Research output: Chapter in Book/Report/Conference proceedingConference Paperpeer-review

24 Citations (Scopus)

Abstract

Programmers often need to initialise circular structures of objects. Initialisation should be safe (so that programs can never suffer null pointer exceptions or otherwise observe uninitialised values) and modular (so that each part of the circular structure can be written and compiled separately). Unfortunately, existing languages do not support modular circular initialisation: programmers in practical languages resort to Tony Hoare's "Billion Dollar Mistake": initialising variables with nulls, and then hoping to fix them up afterward. While recent research languages have offered some solutions, none fully support safe modular circular initialisation. 

We present placeholders, a straightforward extension to object-oriented languages that describes circular structures simply, directly, and modularly. In typed languages, placeholders can be described by placeholder types that ensure placeholders are used safely. We define an operational semantics for placeholders, a type system for placeholder types, and prove soundness. Incorporating placeholders into object-oriented languages should make programs simultaneously simpler to write, and easier to write correctly.

Original languageEnglish
Title of host publicationECOOP 2013, Object-Oriented Programming - 27th European Conference, Proceedings
EditorsGiuseppe Castagna
PublisherSpringer
Pages205-229
Number of pages25
ISBN (Electronic)978-3-642-39038-8
ISBN (Print) 978-3-642-39037-1
DOIs
Publication statusPublished - 2013
Externally publishedYes
Event27th European Conference on Object-Oriented Programming, ECOOP 2013 - Montpellier, France
Duration: 1 Jul 20135 Jul 2013

Publication series

NameLecture Notes in Computer Science
Volume7920 (LNPSE)
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference27th European Conference on Object-Oriented Programming, ECOOP 2013
Country/TerritoryFrance
CityMontpellier
Period1/07/135/07/13

Fingerprint

Dive into the research topics of 'The Billion-Dollar Fix: Safe Modular Circular Initialisation with Placeholders and Placeholder Types'. Together they form a unique fingerprint.

Cite this