paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Syntactic Implicit Parameters with Static Overloading

带有静态重载的句法隐式参数
PLDI 10(PLDI)2026匹配度 2/10 · 论文属于类型系统与语言设计,研究隐式参数和静态重载的形式化与实现,与用户关注的静态分析、ML/Agent 程序分析、LLM×PL、浮点或贝叶斯程序分析无直接交集。虽然包含形式化和工程实现,但研究问题不匹配。引用 0 inbox
Daan Leijen, Tim Whiting
crossref: 2026-09-10

AI 速览

一句话:提出句法隐式参数与静态重载两个正交机制,以简单实现覆盖隐式参数的常见用法。

隐式参数提供了一种强大的基于项的推理机制,使“显然”的实参可被省略并由类型检查器推断,从而减轻程序员负担并提高表达清晰度。Haskell/Lean 的类型类、Scala 的 implicit 等系统虽实用,但日益复杂且实现成本高。本文重新审视该设计空间,提出两个正交且各自范围有限、实现直接的特征:句法隐式参数与静态重载。两者结合后表达力出乎意料地强,可覆盖实践中隐式参数的许多常见场景。作者形式化了该系统并给出多种示例,证明 elaboration 具有一致性,同时给出推理算法并证明其可靠且完备。系统已在 Koka 语言中完整实现,论文还报告了大规模使用经验并讨论了进一步扩展。

问题
现有隐式参数与类型类等机制功能强大但设计日趋复杂、实现负担重,如何以更简单的机制覆盖常见隐式参数使用场景。
方法
提出句法隐式参数与静态重载两个正交特性,对系统进行形式化并给出示例,证明 elaboration 一致性,并设计可靠且完备的推理算法。
评估
在 Koka 语言中完整实现该系统,报告大规模使用经验并讨论进一步扩展。
原文摘要(Abstract)

Implicits provide a powerful mechanism for term-based inference, where "obvious" arguments can be omitted and inferred by the type checker. This can greatly reduce the programmer's burden and improve the clarity of expression. As such, many languages support a form of implicits in practice, such as type classes in Haskell or Lean, or implicits in Scala. Unfortunately, many of these systems have become increasingly complex and often require significant implementation effort. In this paper we take a fresh look at the design space with an arguably simpler approach based on two orthogonal features: _syntactic implicit parameters_ and _static overloading_. Each of these features is limited in scope and has a straightforward implementation. Taken together though, they are surprisingly expressive and we believe they can cover many of the common usage scenarios of implicits in practice. We formalize our system and provide various examples, and prove our elaboration is coherent. We also give an inference algorithm and show it is sound and complete. Our system is fully implemented in the Koka language, and we describe our experience with these features at scale, and discuss further extensions.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{LeijenW26,
  title = {Syntactic Implicit Parameters with Static Overloading},
  author = {Daan Leijen and Tim Whiting},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {PLDI},
  year = {2026},
  doi = {10.1145/3808336}
}