<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 &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; 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 &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; 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 &lt;<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-evolution@swift.org')">swift-evolution@swift.org</a>&gt; wrote:<br>
<br>
&gt; Has there been a garbage collection thread so far? I understand that<br>
&gt; reference counting vs. garbage collection can be a heated debate, but<br>
&gt; it might be relevant to have it.<br>
&gt;<br>
&gt; It seems to me that the two principal upsides of reference counting<br>
&gt; are that destruction is (essentially) deterministic and performance is<br>
&gt; more easily predicted. However, it comes with many downsides:<br>
&gt;<br>
&gt; object references are expensive to update<br>
&gt; object references cannot be atomically updated<br>
&gt; heap fragmentation<br>
&gt; the closure capture syntax uses up an unreasonable amount of mindshare<br>
&gt; just because of [weak self]<br>
&gt;<br>
&gt; Since Swift doesn't expose memory management operations outside of<br>
&gt; `autoreleasepool`, it seems to me that you could just drop in a<br>
&gt; garbage collector instead of reference counting and it would work (for<br>
&gt; most purposes).<br>
&gt;<br>
&gt; Has a GC been considered at all?<br>
<br>
Yes.&nbsp; Among other problems, you can't do copy-on-write efficiently with<br>
a GC, because you can't detect a unique reference.&nbsp; 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>