Speak Now: 通过多方会话类型实现安全的Actor编程(扩展版)
Speak Now: Safe Actor Programming with Multiparty Session Types (Extended Version)
AI总结:
Maty是首个支持静态多方会话类型和多会话Actor的编程语言,通过流敏感效果系统和事件驱动编程实现通信安全与系统容错。
摘要:
如Erlang和Elixir这样的Actor语言被广泛用于实现可扩展和可靠的分布式应用,但Actor通信模式的非正式规范性使系统容易受到通信不匹配和死锁等成本高昂的错误影响。多方会话类型(MPSTs)在开发过程中可以排除通信错误,但直到现在,Actor通信的多发送单接收性质使得Actor语言难以从会话类型中获益。本文介绍了Maty,这是首个支持静态多方会话类型和参与多个会话的Actor语言的完整设计。Maty因此结合了会话类型的错误预防机制与Actor语言的可扩展性和容错性。我们的主要见解是通过一种流敏感的效果系统强制执行会话类型,结合事件驱动的编程风格和一等消息处理程序。使用MPSTs可以保证通信安全性:进程将永远不会发送或接收意外消息,也不会因为某个Actor在等待永远不会发送的消息而使会话卡住。我们扩展Maty以支持Erlang风格的监督和级联故障,并展示这保留了Maty的强元理论。我们使用Scala通过API生成方法实现Maty,并通过实现广泛使用的Savina Actor基准测试套件中的代表性样本、行业提供的工厂场景和聊天服务器来展示我们模型的表达力。
英文摘要:
Actor languages such as Erlang and Elixir are widely used for implementing scalable and reliable distributed applications, but the informally-specified nature of actor communication patterns leaves systems vulnerable to costly errors such as communication mismatches and deadlocks. Multiparty session types (MPSTs) rule out communication errors early in the development process, but until now, the many-sender, single-receiver nature of actor communication has made it difficult for actor languages to benefit from session types. This paper introduces Maty, the first actor language design supporting both static multiparty session typing and the full power of actors taking part in multiple sessions. Maty therefore combines the error prevention mechanism of session types with the scalability and fault tolerance of actor languages. Our main insight is to enforce session typing through a flow-sensitive effect system, combined with an event-driven programming style and first-class message handlers. Using MPSTs allows us to guarantee communication safety: a process will never send or receive an unexpected message, nor will a session get stuck because an actor is waiting for a message that will never be sent. We extend Maty to support Erlang-style supervision and cascading failure, and show that this preserves Maty's strong metatheory. We implement Maty in Scala using an API generation approach, and demonstrate the expressiveness of our model by implementing a representative sample of the widely-used Savina actor benchmark suite; an industry-supplied factory scenario; and a chat server.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。