Objects as session-typed processes

Abstract

A key idea in object-oriented programming is that objects encapsulate state and interact with each other by message exchange. This perspective suggests a model of computation that is inherently concurrent (to facilitate simultaneous mes-sage exchange) and that accounts for the effect of message exchange on an object’s state (to express valid sequences of state transitions). In this paper we show that such a model of computation arises naturally from session-based commu-nication. We introduce an object-oriented programming lan-guage that has processes as its only objects and employs lin-ear session types to express the protocols of message ex-change and to reason about concurrency and state. Based on various examples we show that our language supports the typical patterns of object-oriented programming (e.g., en-capsulation, dynamic dispatch, and subtyping) while guar-anteeing session fidelity in a concurrent setting. In addition, we show that our language facilitates new forms of expres-sion (e.g., type-directed reuse, internal choice), which are not available in current object-oriented languages. We have implemented our language in a prototype compiler

    Similar works

    Full text

    thumbnail-image

    Available Versions