当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Counting Immutable Beans: Reference Counting Optimized for Purely Functional Programming
arXiv - CS - Programming Languages Pub Date : 2019-08-15 , DOI: arxiv-1908.05647
Sebastian Ullrich and Leonardo de Moura

Most functional languages rely on some garbage collection for automatic memory management. They usually eschew reference counting in favor of a tracing garbage collector, which has less bookkeeping overhead at runtime. On the other hand, having an exact reference count of each value can enable optimizations, such as destructive updates. We explore these optimization opportunities in the context of an eager, purely functional programming language. We propose a new mechanism for efficiently reclaiming memory used by nonshared values, reducing stress on the global memory allocator. We describe an approach for minimizing the number of reference counts updates using borrowed references and a heuristic for automatically inferring borrow annotations. We implemented all these techniques in a new compiler for an eager and purely functional programming language with support for multi-threading. Our preliminary experimental results demonstrate our approach is competitive and often outperforms state-of-the-art compilers.

中文翻译:

计数不可变 Bean:针对纯函数式编程优化的引用计数

大多数函数式语言依赖于一些垃圾收集来进行自动内存管理。他们通常会避开引用计数,转而使用跟踪垃圾收集器,后者在运行时的簿记开销较少。另一方面,拥有每个值的精确引用计数可以实现优化,例如破坏性更新。我们在热切的纯函数式编程语言的上下文中探索这些优化机会。我们提出了一种有效回收非共享值使用的内存的新机制,减少了全局内存分配器的压力。我们描述了一种使用借用引用和启发式自动推断借用注释来最小化引用计数更新次数的方法。我们在一个新的编译器中实现了所有这些技术,用于支持多线程的热切和纯函数式编程语言。我们的初步实验结果表明我们的方法具有竞争力,并且通常优于最先进的编译器。
更新日期:2020-03-06
down
wechat
bug