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.


翻译:诸如Erlang和Elixir等行动者语言被广泛用于实现可扩展且可靠的分布式应用,但行动者通信模式缺乏形式化规范的本质使得系统容易遭受通信失配和死锁等代价高昂的错误。多参与者会话类型能在开发过程早期排除通信错误,然而迄今为止,行动者通信的多发送方、单接收方特性使得行动者语言难以受益于会话类型。本文提出Maty——首个同时支持静态多参与者会话类型系统与行动者参与多重会话完整能力的行动者语言设计。Maty由此将会话类型的错误预防机制与行动者语言的可扩展性和容错性相结合。我们的核心洞见在于通过流敏感效应系统,结合事件驱动编程风格和一等消息处理器来强制执行会话类型。使用多参与者会话类型使我们能够保证通信安全性:进程永远不会发送或接收意外消息,会话也不会因行动者等待永远不会发送的消息而陷入停滞。我们将Maty扩展至支持Erlang风格的监督与级联故障,并证明这保持了Maty强大的元理论特性。我们采用API生成方法在Scala中实现了Maty,并通过实现广泛使用的Savina行动者基准测试套件的代表性示例、工业提供的工厂场景以及聊天服务器,展示了我们模型的表达能力。

0
下载
关闭预览

相关内容

人们为了让计算机解决各种棘手的问题,使用编程语言 编写程序代码并通过计算机运算得到最终结果的过程。
综述:面向移动端大语言模型的隐私与安全
专知会员服务
19+阅读 · 2025年9月7日
大语言模型安全开发者手册:构建安全的 AI 应用程序
专知会员服务
35+阅读 · 2024年9月29日
大型语言模型网络安全综述
专知会员服务
68+阅读 · 2024年5月12日
【2024新书】大型语言模型安全开发者手册,250页pdf
专知会员服务
76+阅读 · 2024年2月12日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
对话系统近期进展
专知
37+阅读 · 2019年3月23日
NLP实践:对话系统技术原理和应用
AI100
34+阅读 · 2019年3月20日
最新人机对话系统简略综述
专知
26+阅读 · 2018年3月10日
多轮对话之对话管理:Dialog Management
PaperWeekly
18+阅读 · 2018年1月15日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
重新思考无人机时代的生存能力
专知会员服务
2+阅读 · 今天7:44
装甲突击旅:现代战争思考、战斗与组织
专知会员服务
2+阅读 · 今天7:28
在人工智能加速决策环境中拓展OODA循环
专知会员服务
3+阅读 · 今天7:18
军事欺骗:供作战战术指挥官使用的工具
专知会员服务
3+阅读 · 今天7:03
综述 | 世界动作模型:少做梦,多行动
专知会员服务
5+阅读 · 6月23日
美以伊冲突:无人机与人工智能的运用
专知会员服务
10+阅读 · 6月23日
《特种部队在透明战场中的生存力》最新报告
专知会员服务
5+阅读 · 6月23日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员