paperbot · PL 论文追踪

RSS

Corpse reviver: sound and efficient gradual typing via contract verification

POPL 5(POPL)2021
Cameron Moy, Phúc C. Nguyễn, Sam Tobin-Hochstadt, David Van Horn

尚未生成 AI 速览(可能缺少 API key 或等待下次运行补跑)。

原文摘要(Abstract)

Gradually typed programming languages permit the incremental addition of static types to untyped programs. To remain sound, languages insert run-time checks at the boundaries between typed and untyped code. Unfortunately, performance studies have shown that the overhead of these checks can be disastrously high, calling into question the viability of sound gradual typing. In this paper, we show that by building on existing work on soft contract verification, we can reduce or eliminate this overhead. Our key insight is that while untyped code cannot be trusted by a gradual type system, there is no need to consider only the worst case when optimizing a gradually typed program. Instead, we statically analyze the untyped portions of a gradually typed program to prove that almost all of the dynamic checks implied by gradual type boundaries cannot fail, and can be eliminated at compile time. Our analysis is modular, and can be applied to any portion of a program. We evaluate this approach on a dozen existing gradually typed programs previously shown to have prohibitive performance overhead—with a median overhead of 2.5× and up to 80.6× in the worst case—and eliminate all overhead in most cases, suffering only 1.5× overhead in the worst case.

链接与引用

DOI 原文 ·

BibTeX
@article{paperbot1177,
  title = {Corpse reviver: sound and efficient gradual typing via contract verification},
  author = {Cameron Moy and Phúc C. Nguyễn and Sam Tobin-Hochstadt and David Van Horn},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {5},
  number = {POPL},
  year = {2021},
  doi = {10.1145/3434334}
}