Over the past thirty years, there has been significant progress in developing general-purpose, language-based approaches to incremental computation, which aims to efficiently update the result of a computation when an input is changed. A key design challenge in such approaches is how to provide efficient incremental support for a broad range of programs. In this paper, we argue that first-class names are a critical linguistic feature for efficient incremental computation. Names identify computations to be reused across differing runs of a program, and making them first class gives programmers a high level of control over reuse. We demonstrate the benefits of names by presenting NOMINAL ADAPTON, an ML-like language for incremental computation with names. We describe how to use NOMINAL ADAPTON to efficiently incrementalize several standard programming patterns -- including maps, folds, and unfolds -- and show how to build efficient, incremental probabilistic trees and tries. Since NOMINAL ADAPTON's implementation is subtle, we formalize it as a core calculus and prove it is from-scratch consistent, meaning it always produces the same answer as simply re-running the computation. Finally, we demonstrate that NOMINAL ADAPTON can provide large speedups over both from-scratch computation and ADAPTON, a previous state-of-the-art incremental computation system.
翻译:在过去三十年中,在制定通用的、基于语言的增量计算方法方面取得了重大进展,该方法的目的是在改变输入时有效更新计算结果。这些方法中的一个关键设计挑战是如何为范围广泛的程序提供高效的增量支持。在本文中,我们争论说,一等名称是高效增量计算的关键语言特征。名称确定一个程序的不同运行运行中应再利用的计算方法,并使它们使第一流程序员对再利用拥有高度的控制。我们通过展示一个类似于ML的、用于用名称进行增量计算的语言NOMINAL ADAPTON来展示名称的好处。我们描述了如何使用NOMINAL ADAPTON来高效地逐步增加一些标准程序模式 -- -- 包括地图、折叠式和展式 -- 并展示如何建立高效的、递增的概率性树木和尝试。由于NOMINAL ADAPTON的安装过程很微妙,我们把它正规化为核心的计算方法,并证明它是来自加密的,意味着它总是产生相同的答案,而只是重新进行计算。最后,我们演示如何使用NOMINAL ADADADADADAR 的计算方法,从以往的递增的计算系统提供一个超高速。