Rust is a non-Garbage Collected (GCed) language, but the lack of GC makes expressing data-structures that require shared ownership awkward, inefficient, or both. In this paper we explore a new design for, and implementation of, GC in Rust, called Alloy. Unlike previous approaches to GC in Rust, Alloy maps existing Rust destructors to finalizers: this makes GC in Rust natural to use but introduces surprising soundness, performance, and ergonomic problems. Alloy provides solutions for each of these problems.
翻译:Rust是一种非垃圾回收(GC)语言,但缺乏GC机制使得表达需要共享所有权的数据结构变得笨拙、低效或两者兼有。本文探讨了一种名为Alloy的Rust垃圾回收新设计与实现。与先前Rust中的GC方法不同,Alloy将现有的Rust析构器映射到终结器:这使得Rust中的GC使用起来更自然,但引入了令人惊讶的正确性、性能和易用性问题。Alloy为每个问题提供了解决方案。