arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1611.06276cs.PL
收藏

混合隐喻:演员作为渠道和渠道作为演员(扩展版)

Mixing Metaphors: Actors as Channels and Channels as Actors (Extended Version)

Simon Fowler, Sam Lindley, Philip Wadler

摘要:

基于通道和基于角色的程序设计语言在实践中都有使用,但这两者经常被混淆。像Go这样的语言提供了匿名进程,它们使用缓冲区或集合点(称为通道)进行通信,而像Erlang这样的语言提供了可寻址进程(称为参与者),每个进程都有一个传入的消息队列。由于缺乏一个共同的表征,很难对民间传说中存在的翻译进行推理。我们为类型化异步通道定义了一个演算$λ_{\textrm{ch}}$,为类型化参与者定义了一个演算$λ_{\textrm{act}}$。我们定义了从$λ_{\textrm{act}}$到$λ_{\textrm{ch}}$和$λ_{\textrm{ch}}$到$λ_{\textrm{act}}$的翻译,并证明了两者都是类型和语义保持的。我们表明,我们的方法占同步和选择性接收演员系统,并讨论未来的扩展,以支持守卫的选择和行为类型。

英文摘要:

Channel- and actor-based programming languages are both used in practice, but the two are often confused. Languages such as Go provide anonymous processes which communicate using buffers or rendezvous points---known as channels---while languages such as Erlang provide addressable processes---known as actors---each with a single incoming message queue. The lack of a common representation makes it difficult to reason about translations that exist in the folklore. We define a calculus $λ_{\textrm{ch}}$ for typed asynchronous channels, and a calculus $λ_{\textrm{act}}$ for typed actors. We define translations from $λ_{\textrm{act}}$ into $λ_{\textrm{ch}}$ and $λ_{\textrm{ch}}$ into $λ_{\textrm{act}}$ and prove that both are type- and semantics-preserving. We show that our approach accounts for synchronisation and selective receive in actor systems and discuss future extensions to support guarded choice and behavioural types.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑