跳到正文
研踪PaperTrail
← 研踪 PaperTrail

arXiv:2611.26563 · v1

You Have Mail: Set-Theoretic Types for Actors

你有邮件:面向Actor的集合论类型

首次提交 2026-11-20 02:30
版本更新 2026-11-20 02:30
雷达观测 2026-11-20 12:52
arXiv ↗PDF ↗

摘要

We present a type system for the processes of Elixir, a dynamic language based on the actor model whose static type system covers only its functional core. Each process is typed by pid(t)\mathtt{pid}(t), where the ``interface'' tt is the type of the messages the process expects in its mailbox: sends are checked against the recipient's interface, and receives rely on the interface of the process that performs them. One of the difficulties of typing Elixir is that mailboxes are implicit: a function shipped in a message may evaluate self()\mathtt{self()} and execute receive instructions, and both refer to whichever process eventually runs the function---self()\mathtt{self()} returns that process's pid, receive reads that process's mailbox---so the mailbox they act on is not known where the function is written. We solve this problem by inferring, for every function, bounds on the type of the mailboxes it can be used with; as a result, the system types higher-order functions that travel in messages even when they contain reference to self()\mathtt{self()} and receive instructions. The only new annotation the programmer writes is the interface of each spawned process; everything else is inferred by reusing the existing subtyping and constraint-resolution machinery of Elixir, and the system is proved sound. For legacy code, the interface can be reconstructed from the receive clauses: what the branches do with their messages bounds it from above, and the most permissive solution is sharp enough to recover received pids and closures.

AI 论文解读

基于摘要 · 非全文审阅

为Elixir的Actor进程提出一种静态类型系统,通过推断函数可用的邮箱类型边界,支持高阶函数在消息中传递并引用self()和receive,且仅需标注进程接口。

正在读取账号与研究记录…

版本差异

目前只收录了一个版本。收录下一版后,可以对照标题、作者、分类和摘要。

观测到的版本

相邻记录可能跳过中间版本;首次发现 v2 及以上也会标为版本更新。

v1 · 2026-11-20 02:30 · 最新观测版本

You Have Mail: Set-Theoretic Types for Actors

We present a type system for the processes of Elixir, a dynamic language based on the actor model whose static type system covers only its functional core. Each process is typed by pid(t)\mathtt{pid}(t), where the ``interface'' tt is the type of the messages the process expects in its mailbox: sends are checked against the recipient's interface, and receives rely on the interface of the process that performs them. One of the difficulties of typing Elixir is that mailboxes are implicit: a function shipped in a message may evaluate self()\mathtt{self()} and execute receive instructions, and both refer to whichever process eventually runs the function---self()\mathtt{self()} returns that process's pid, receive reads that process's mailbox---so the mailbox they act on is not known where the function is written. We solve this problem by inferring, for every function, bounds on the type of the mailboxes it can be used with; as a result, the system types higher-order functions that travel in messages even when they contain reference to self()\mathtt{self()} and receive instructions. The only new annotation the programmer writes is the interface of each spawned process; everything else is inferred by reusing the existing subtyping and constraint-resolution machinery of Elixir, and the system is proved sound. For legacy code, the interface can be reconstructed from the receive clauses: what the branches do with their messages bounds it from above, and the most permissive solution is sharp enough to recover received pids and closures.

查看此版本解读 →查看此版本原文 ↗