4 ms·
> Compile-time memory management requires designing your programs in a way you might not be used to, but it definitely beats manual memory management, or lettin
by abalone 8y ago
> Compile-time memory management requires designing your programs in a way you might not be used to, but it definitely beats manual memory management, or letting a runtime take care of garbage collection.
What about Automatic Reference Counting a la Swift / Objective-C?
Seems like a nice blend: compiler assisted, much less runtime overhead than traditional garbage collection, simple programming model.
- zoul 8y agoI too have always found ARC to be the sweet spot, the only downside is still having to care about retain cycles.
- cortesoft 8y agoRust supports reference counting for places where you need it. There is both the RC and ARC datatypes.
- steveklabnik 8y agoAnd to be clear, Swift’s ARC and Rust’s Arc are different; automatic vs atomic. Swift’s ARC is automatic usage of Rust’s Arc type, if that makes any sense.
- fulafel 8y agoIs are there some special properties in Apple's implementation that would make their ARC competitive with state of the art GC?
- abalone 8y agoDepends what you mean by competitive. Generally speaking reference counting offers better memory efficiency and more deterministic performance than tracing. These are usually desirable traits for mobile apps and games, and in many cases servers too.