按年被提到
20192023 · 3 次2026
编程语言与编译器›类型系统与函数式语言·arXiv:1908.05647 · cs.PL

Counting Immutable Beans: Reference Counting Optimized for Purely Functional Programming

数不清的不可变豆子:为纯函数式编程优化的引用计数
Sebastian Ullrich, Leonardo de Moura · 2019

为纯函数式语言设计的引用计数,支持原地更新

开始阅读 ↗PDFalphaXiv 讨论
被推荐 · 8 人首次 2019-08-22 · 最近 2025-02-25
8不同的人
9活跃月份
8讨论串
4被引(OpenAlex)

论文探讨在及早求值的纯函数式语言中用引用计数替代追踪式垃圾回收:精确的引用计数使未共享的值可以被原地销毁和复用,从而减轻全局分配器压力。作者还提出借用引用(borrowed references)与自动推断借用标注的启发式,以减少引用计数更新,并在支持多线程的新编译器中实现,初步结果显示性能有竞争力,常优于现有编译器。

HN 为什么提它

HN 上的人引用它来解释 Lean 4 如何在纯函数式代码里用引用计数做原地更新(例如数组 O(1) 修改),并拿它和其他语言的内存管理思路类比。

方法难度 4 / 5约 45 分钟经得起时间
读之前最好知道
1引用计数与垃圾回收
2纯函数式编程
3编译器优化
4不可变数据结构
5所有权与借用(borrowing)

HN 书评

推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及
推荐agentultra · 2022-07

“A paper I quite enjoyed on automatic reference counting for pure, immutable functional programming”

推荐它:纯不可变函数式编程的自动引用计数,读得很享受
Reference count, don't garbage collect原评论 ↗
引用lakecresva · 2020-12

“Lean 4 is in the same ballpark as Haskell, Swift, and ML.”

引它说明 Lean 4 性能与 Haskell、Swift、ML 相当
A Review of the Lean Theorem Prover原评论 ↗
引用tomhoule · 2021-02

“that details how the runtime makes use of reference counts to do destructive updates in pure code whenever possible.”

引它说明运行时如何用引用计数在纯代码里做原地更新
A simple ray tracer in Lean 4原评论 ↗
引用nequo · 2022-09

“but destructive updates can help with that:”

引它说明原地更新可缓解该问题
Ask HN: Is Clojure Dead?原评论 ↗
引用francasso · 2023-06

“I'm sure the details are different, but the general idea, to me, seems the same as the one descibed by Leo and Sebastian in Counting Immutable Beans.”

认为它与另一思路大体相同:用引用计数原地复用数据结构
Microsoft Research: Fully In-Place Functional Programming [pdf]原评论 ↗
引用dunham · 2023-10

“So I was able to efficiently use C-style arrays (O(1) update/lookup) while writing functional code. (paper: Counting Immutable Beans )”

引它解释函数式代码里如何高效使用 C 风格数组
Lean4 helped Terence Tao discover a small bug in his recent paper原评论 ↗
看全部 8 条 →
引用yashrk · 2023-11

“«Counting Immutable Beans» by Sebastian Ullrich and Leonardo de Moura”

点名引用这篇论文及其作者
引用agentultra · 2025-02

“There might even be some possibility for cross-pollination with ideas such as Counting Immutable Beans [0].”

认为其想法可与当前话题相互借鉴
Neut Programming Language原评论 ↗
被提交为 story · 1 次