Compiling Self-Adjusting Programs with Continuations

被引:0
|
作者
Ley-Wild, Ruy [1 ]
Fluet, Matthew [1 ]
Acar, Umut A. [1 ]
机构
[1] Carnegie Mellon Univ, Pittsburgh, PA 15213 USA
关键词
self-adjusting computation; continuation-passing style; memoization;
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Self-adjusting programs respond automatically and efficiently to input changes by tracking the dynamic data dependences of the computation and incrementally updating the output as needed. In order to identify data dependences, previously proposed approaches require the user to make use of a set of monadic primitives. Rewriting an ordinary program into a self-adjusting program with these primitives, however, can be difficult and error-prone due to various monadic and proper-usage restrictions, some of which cannot be enforced statically. Previous work therefore suggests that self-adjusting computation would benefit from direct language and compiler support. In this paper, we propose a language-based technique for writing and compiling self-adjusting programs from ordinary programs. To compile self-adjusting programs, we use a continuation-passing style (cps) transformation to automatically infer a conservative approximation of the dynamic data dependences. To prevent the inferred, approximate dependences from degrading the performance of change propagation, we generate memoized versions of cps functions that can reuse previous work even when they are invoked with different continuations. The approach offers a natural programming style that requires minimal changes to existing code, while statically enforcing the invariants required by self-adjusting computation. We validate the feasibility of our proposal by extending Standard ML and by integrating the transformation into MLton, a whole-program optimizing compiler for Standard ML. Our experiments indicate that the proposed compilation technique can produce self-adjusting programs whose performance is consistent with the asymptotic bounds and experimental results obtained via manual rewriting (up to a constant factor).
引用
收藏
页码:321 / 333
页数:13
相关论文
共 50 条
  • [1] Compiling self-adjusting programs with continuations
    Ley-Wild, Ruy
    Fluet, Matthew
    Acar, Umut A.
    [J]. ACM SIGPLAN NOTICES, 2008, 43 (09) : 321 - 333
  • [2] Implicit Self-Adjusting Computation for Purely Functional Programs
    Chen, Yan
    Dunfield, Joshua
    Hammer, Matthew A.
    Acar, Umut A.
    [J]. ICFP 11 - PROCEEDINGS OF THE 2011 ACM SIGPLAN: INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING, 2011, : 129 - 141
  • [3] Implicit Self-Adjusting Computation for Purely Functional Programs
    Chen, Yan
    Dunfield, Joshua
    Hammer, Matthew A.
    Acar, Umut A.
    [J]. ACM SIGPLAN NOTICES, 2011, 46 (09) : 129 - 141
  • [4] Implicit self-adjusting computation for purely functional programs
    Chen, Yan
    Dunfield, Joshua
    Hammer, Matthew A.
    Acar, Umut A.
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2014, 24 (01) : 56 - 112
  • [5] A SELF-ADJUSTING CONTROLLER
    DAVIES, WDT
    [J]. BRITISH CHEMICAL ENGINEERING, 1967, 12 (08): : 1227 - &
  • [6] Self-adjusting Bootstrapping
    Fujiwara, Shoji
    Sekine, Satoshi
    [J]. COMPUTATIONAL LINGUISTICS AND INTELLIGENT TEXT PROCESSING, PT II, 2011, 6609 : 188 - +
  • [7] Self-adjusting computation
    Harper, R
    [J]. AUTOMATA , LANGUAGES AND PROGRAMMING, PROCEEDINGS, 2004, 3142 : 1 - 2
  • [8] SELF-ADJUSTING HEAPS
    SLEATOR, DD
    TARJAN, RE
    [J]. SIAM JOURNAL ON COMPUTING, 1986, 15 (01) : 52 - 69
  • [9] Compiling with Continuations, Correctly
    Paraskevopoulou, Zoe
    Grover, Anvay
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5 (OOPSLA):
  • [10] Compiling with Continuations, Continued
    Kennedy, Andrew
    [J]. ICFP'07 PROCEEDINGS OF THE 2007 ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING, 2007, : 177 - 190