[swift-evolution] [Manifesto] Ownership

Michel Fortin michel.fortin at michelf.ca
Mon Mar 6 15:48:29 CST 2017


> On 6 mars 2017, at 15:53, John McCall via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Class types have reference semantics and are still copyable; ownership is not going to change that.  More generally, I don't see how anything we can do in ownership could ever do something like eliminate the possibility of a reference-semantics collection from the language.

I'll just drop a note to say that I explained how we could implement provable value-type semantics in the discussion about "pure" a few weeks ago. This was the overview:
https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170220/032582.html <https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170220/032582.html>

The part that might have some relation to ownership is the notion in the type system that a pointer is guarantied to be uniquely referenced. You can check for that at runtime with `isUniquelyReferenced`, but that information is lost as soon as the call returns. If there was a way to safely flag a variable as a "unique reference" and for the compiler to detect when the uniqueness might be broken, then it'd open the door to the compiler being able to enforce value-type semantics.

-- 
Michel Fortin
https://michelf.ca

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170306/43dc4e47/attachment.html>


More information about the swift-evolution mailing list