一句话:提出基于化学隐喻的 typestate 导向编程,以消息分子和化学反应建模并发状态变换,并用行为类型控制对象协议与共享。
论文针对 typestate 面向对象编程通常假定对象状态由单一控制流访问和修改的局限,提出一种基于化学隐喻的方法:对象状态与操作被表示为消息分子,状态转移被表示为化学反应。由此可在本质并发的环境中研究 typestate,多个进程能同时访问对象并只修改其部分状态。作者引入简单的行为类型理论,统一表达对象的私有与公共接口,描述并强制由可能性、禁止与义务构成的结构化对象协议,同时控制对象共享。其贡献是为并发 typestate 提供统一的协议规范与类型化机制,摘要未报告实证性能评估。
We introduce a novel approach to typestate-oriented programming based on the chemical metaphor: state and operations on objects are molecules of messages, and state transformations are chemical reactions. This approach allows us to investigate typestate in an inherently concurrent setting, whereby objects can be accessed and modified concurrently by several processes, each potentially changing only part of their state. We introduce a simple behavioral type theory to express in a uniform way both the private and the public interfaces of objects; describe and enforce structured object protocols consisting of possibilities, prohibitions, and obligations; and control object sharing.
@article{CrafaP17,
title = {The Chemical Approach to Typestate-Oriented Programming},
author = {Silvia Crafa and Luca Padovani},
journal = {ACM Transactions on Programming Languages and Systems},
volume = {39},
number = {3},
year = {2017},
doi = {10.1145/3064849}
}