TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Adapton: Programming Language Abstractions for Incremental Computation

27 点作者 cemerick将近 10 年前

4 条评论

mahmud将近 10 年前
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?
amelius将近 10 年前
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.
mynegation将近 10 年前
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 未加载
TerryADavis将近 10 年前
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.