TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Adapton: Programming Language Abstractions for Incremental Computation

27 pointsby cemerickalmost 10 years ago

4 comments

mahmudalmost 10 years ago
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) =&gt; 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))) =&gt; 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 &#x27;two 3) </code></pre> And I&#x27;m assuming ADD-TWO will get recomputed, how would this work? Which &quot;two&quot; 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&#x2F;Oz constraint store?<p>Can someone explain how this works actually?
ameliusalmost 10 years ago
Exciting stuff. I&#x27;m hoping for an implementation that targets Javascript, and which will be a fundamentally more powerful and more efficient alternative to libraries like React.
mynegationalmost 10 years ago
On a _very_ high-level it is like a spreadsheet model of computation: build the dependencies between calculations, propagate value changes to the dependent calculations, but with two important improvements: per-node memoization of the previous calculations and ignoring updates that will not lead to the change of something visible to the user in the UI.
评论 #9781479 未加载
TerryADavisalmost 10 years ago
My compiler compiles 100,000 lines of code a second.<p>50,000 lines are compiled during boot (half a second).<p>50,000 lines are compiled during MakeAll (half a second).<p>If you echo to screen, compiles slowly.