Anyone know how incremental-computation related to partial-evaluation or staged-computation?<p>I haven’t dug into the IC papers yet, but from my understanding.<p>Partial-Evaluation is specialization of function over arguments. Say f(x,y,z) => v, a partially computed function f’(x,y) can be computed by binding ‘z’. Thus, applying f’ to (x,y) will yield the same value ‘v’ as f(x,y,z).<p>Staged-Computation is a generalization (restriction?) of partial-evaluation, but for meta-programs that generate other programs. That’s to say, the result value v of a staged meta-program M is itself a computable function. M(f(x,y,z)) the meta-program that generates previous function f can itself be decomposed to multiple steps M’’(M’(f(x,y,z))) => M(f,x,z), but having those intervening steps of computation openly accessible allows for interesting program manipulation possibilities. Which is why staged-computation subsumes everything from compiler generation, to macros, to runtime optimization.<p>So, Incremental-Computation (is?) looks to me like partial-evaluation + reactive programming? That is, a PE’ed function will get recomputed if any of its arguments change value? This doesn’t make in a formal model like the lambda calculus, which captures values and renames variables. So perhaps there is something other than call-by-value at work here?<p><pre><code> (define add-two
(let ((two 2))
(lambda (x)
(+ x two))))
</code></pre>
If I were then to say<p><pre><code> (incremental-computation:change-value 'two 3)
</code></pre>
And I'm assuming ADD-TWO will get recomputed, how would this work? Which "two" will be changed? Will it replace the captured value in the body of the lambda, or does it reify captured variables of each function into a global symbol-table, a la the Mozart/Oz constraint store?<p>Can someone explain how this works actually?