Objects as session-typed processes

Stephanie Balzer, F. Pfenning
{"title":"Objects as session-typed processes","authors":"Stephanie Balzer, F. Pfenning","doi":"10.1145/2824815.2824817","DOIUrl":null,"url":null,"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 message 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 communication. We introduce an object-oriented programming language that has processes as its only objects and employs linear session types to express the protocols of message exchange 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., encapsulation, dynamic dispatch, and subtyping) while guaranteeing session fidelity in a concurrent setting. In addition, we show that our language facilitates new forms of expression (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.","PeriodicalId":316006,"journal":{"name":"Proceedings of the 5th International Workshop on Programming Based on Actors, Agents, and Decentralized Control","volume":"37 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-10-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"8","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 5th International Workshop on Programming Based on Actors, Agents, and Decentralized Control","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2824815.2824817","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 8

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 message 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 communication. We introduce an object-oriented programming language that has processes as its only objects and employs linear session types to express the protocols of message exchange 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., encapsulation, dynamic dispatch, and subtyping) while guaranteeing session fidelity in a concurrent setting. In addition, we show that our language facilitates new forms of expression (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.
对象作为会话类型的进程
面向对象编程的一个关键思想是对象封装状态并通过消息交换相互交互。这种观点提出了一种计算模型,它本质上是并发的(为了方便同时的消息交换),并且考虑了消息交换对对象状态的影响(为了表达有效的状态转换序列)。在本文中,我们证明了这种计算模型自然地产生于基于会话的通信。我们引入了一种面向对象的编程语言,它将进程作为唯一的对象,并使用线性会话类型来表达消息交换协议,并对并发性和状态进行推理。基于各种示例,我们展示了我们的语言支持面向对象编程的典型模式(例如,封装、动态调度和子类型),同时保证并发设置中的会话保真度。此外,我们还展示了我们的语言促进了新的表达式形式(例如,面向类型的重用、内部选择),这在当前的面向对象语言中是不可用的。我们已经在一个原型编译器中实现了我们的语言。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信