论文标题

铁氧体:会话类型在生锈中的判断性嵌入

Ferrite: A Judgmental Embedding of Session Types in Rust

论文作者

Chen, Ruo Fei, Balzer, Stephanie, Toninho, Bernardo

论文摘要

\ emph {会话类型}在表达和验证消息通话系统协议方面已证明可行。在实践中,消息传递是一个主导的并发范式,但现实世界软件是没有会话类型的。主流语言中现有的会话类型库的限制是它们限制对线性会话类型的限制,排除了需要共享的应用程序方案,从而使渠道参考的混溶。 本文介绍了铁氧体,这是RUST中的会话类型的浅嵌入,它支持\ emph {linear}和\ emph {shared}会话。铁矿的正式基础构成共享的会话类型微积分$ \ sills $,该$ \ sills $通过小说\ emph {判断性嵌入}技术编码。嵌入的支点是打字判断的概念,该判断允许有关共享和线性资源键入会话的推理。然后将键入规则编码为判断的功能,并具有有效的键入派生表现为良好的RUST程序。铁矿生成的此RUST程序用作\ emph {证书},确保将根据会话类型定义的协议执行应用程序。本文详细介绍了铁氧体的特征和实施,其中包括有关在铁岩中实施伺服帆布组件的案例研究。

\emph{Session types} have proved viable in expressing and verifying the protocols of message-passing systems. While message passing is a dominant concurrency paradigm in practice, real world software is written without session types. A limitation of existing session type libraries in mainstream languages is their restriction to linear session types, precluding application scenarios that demand sharing and thus aliasing of channel references. This paper introduces Ferrite, a shallow embedding of session types in Rust that supports both \emph{linear} and \emph{shared} sessions. The formal foundation of Ferrite constitutes the shared session type calculus $\sills$, which Ferrite encodes via a novel \emph{judgmental embedding} technique. The fulcrum of the embedding is the notion of a typing judgment that allows reasoning about shared and linear resources to type a session. Typing rules are then encoded as functions over judgments, with a valid typing derivation manifesting as a well-typed Rust program. This Rust program generated by Ferrite serves as a \emph{certificate}, ensuring that the application will proceed according to the protocol defined by the session type. The paper details the features and implementation of Ferrite and includes a case study on implementing Servo's canvas component in Ferrite.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源