<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>On a similar note though, I think if we are taking the point of view that simplifying the memory model and making it safer is worth lots of complexity trade offs I would go all the way in that direction and look real hard at the outcome of MS's project Midori rather than stopping at a GC, but it is kind of getting very off topic so I will cut this short.<br><br>Sent from my iPhone</div><div><br>On 8 Feb 2016, at 21:04, Frank Ecsedy via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div>In fact, Java is looking to introduce value types and will have to wrestle with how to do it in a pure GC environment. For Swift a GC is lots of pain for minimal gain or even a net loss.<br><br>On Monday, February 8, 2016, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
on Mon Feb 08 2016, FĂ©lix Cloutier <<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-evolution@swift.org')">swift-evolution@swift.org</a>> wrote:<br>
<br>
> Has there been a garbage collection thread so far? I understand that<br>
> reference counting vs. garbage collection can be a heated debate, but<br>
> it might be relevant to have it.<br>
><br>
> It seems to me that the two principal upsides of reference counting<br>
> are that destruction is (essentially) deterministic and performance is<br>
> more easily predicted. However, it comes with many downsides:<br>
><br>
> object references are expensive to update<br>
> object references cannot be atomically updated<br>
> heap fragmentation<br>
> the closure capture syntax uses up an unreasonable amount of mindshare<br>
> just because of [weak self]<br>
><br>
> Since Swift doesn't expose memory management operations outside of<br>
> `autoreleasepool`, it seems to me that you could just drop in a<br>
> garbage collector instead of reference counting and it would work (for<br>
> most purposes).<br>
><br>
> Has a GC been considered at all?<br>
<br>
Yes. Among other problems, you can't do copy-on-write efficiently with<br>
a GC, because you can't detect a unique reference. And without<br>
efficient copy-on-write, most interesting value types (Array) are out<br>
the window.<br>
<br>
--<br>
-Dave<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-evolution@swift.org')">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>