简街资本:增量式
Incremental – A library for incremental computations

原始链接: https://github.com/janestreet/incremental

Incremental 是一个函数库,它提供了一种构建复杂计算的方法,能够根据输入的变化高效地进行更新。该库深受 Umut Acar 等人在自调整计算方面研究的启发。Incremental 可应用于多种场景,包括: * 构建大型计算(类似于在电子表格中构建的那种),使其能够对数据的变化做出高效响应。 * 在图形用户界面(GUI)应用程序中构建视图,以便高效地整合新数据。 * 在计算衍生数据时,确保衍生数据与源数据保持同步,例如进行过滤或映射反转。 你可以在 `incremental/src/incremental_intf.ml` 中找到该库的详细文档及使用说明。此外,你也可以通过这篇博客文章和这段视频来了解该库的非正式介绍。

该 Hacker News 讨论帖探讨了 Jane Street 推出的 OCaml 增量计算库 **Incremental**。该库能够仅在输入发生变化时高效地重算计算图中必要的部分,从而避免冗余工作。 讨论的主要观点包括: * **广泛的相关性**:用户指出增量计算在多个领域都有应用,包括 UI 框架(如 SolidJS 或 React 库中的“信号”模式)、构建系统(如 *tup*)以及金融建模(如“银行 Python”系统)。 * **概念区分**:参与者讨论了函数式响应式编程(FRP)与增量计算的定义。尽管两者常被混淆,但增量计算通常被视为一种基于记忆化的图“损坏与修复”方法,而 FRP 则常与事件流或连续时间信号联系在一起。 * **实现挑战**:讨论涉及了“拉取(pull)”与“推送(push)”传播模型之间的权衡、处理动态图结构的难度,以及内存局部性对于高性能应用场景的重要性。 * **替代方案**:参与者分享了多种实现和学术参考资料,如 *Salsa*、*PSAC* 和 *DBSP*,强调尽管核心概念是通用的,但易用性与性能之间的权衡决定了特定领域所适用的最佳工具。
相关文章

原文

Incremental is a library that gives you a way of building complex computations that can update efficiently in response to their inputs changing, inspired by the work of Umut Acar et. al. on self-adjusting computations. Incremental can be useful in a number of applications, including:

  • Building large calculations (of the kind you might build into a spreadsheet) that can react efficiently to changing data.
  • Constructing views in GUI applications that can incorporate new data efficiently.
  • Computing derived data while guaranteeing that the derived data stays in sync with the source data, for instance filtering or inversing a mapping.

You can find detailed documentation of the library and how to use it in incremental/src/incremental_intf.ml. You can also find an informal introduction to the library in this blog post and this video.

联系我们 contact @ memedata.com