[swift-evolution] What about garbage collection?

Douglas Gregor dgregor at apple.com
Mon Feb 8 23:59:58 CST 2016


> On Feb 8, 2016, at 11:56 AM, Félix Cloutier via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Has there been a garbage collection thread so far? I understand that reference counting vs. garbage collection can be a heated debate, but it might be relevant to have it.
> 
> It seems to me that the two principal upsides of reference counting are that destruction is (essentially) deterministic and performance is more easily predicted. However, it comes with many downsides:
> 
> object references are expensive to update
> object references cannot be atomically updated
> heap fragmentation
> the closure capture syntax uses up an unreasonable amount of mindshare just because of [weak self]
> 
> Since Swift doesn't expose memory management operations outside of `autoreleasepool`, it seems to me that you could just drop in a garbage collector instead of reference counting and it would work (for most purposes).
> 
> Has a GC been considered at all?

We very deliberately chose an ARC model for Swift. It is *way* out of scope for Swift 3; I don’t think it’s worth discussing this on swift-evolution at all.

	- Doug


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160208/32ebb025/attachment.html>


More information about the swift-evolution mailing list