[swift-evolution] [Review] SE-0005 Better Translation of Objective-C APIs Into Swift

Charles Kissinger crk at akkyra.com
Mon Feb 1 17:55:23 CST 2016


> On Feb 1, 2016, at 2:08 PM, Tony Parker via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 
>> On Feb 1, 2016, at 1:49 PM, Matthew Johnson <matthew at anandabits.com <mailto:matthew at anandabits.com>> wrote:
>> 
>> 
>>> On Feb 1, 2016, at 3:38 PM, Drew Crawford via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> 
>>> 
>>>> On Feb 1, 2016, at 1:02 PM, Tony Parker <anthony.parker at apple.com <mailto:anthony.parker at apple.com>> wrote:
>>>> 
>>>> Types like NSURL are intended to be the canonical URL for everyone to use,
>>> 
>>> 
>>> I think the "canonical URL for everyone to use" must be a value type / struct.  To me this seems axiomatic.
>>> 
>>> Meanwhile (NS)URL cannot be a value type because of the Darwin compatibility mandate, and to change from value->reference semantics would be "off the charts" breakage severity.
>>> 
>>> This is a requirements conflict.  corelibs-foundation can either be Darwin-compatible or it can be canonical, but we cannot do both.  Right now we have chosen Darwin-compatible, so we must let the canonical requirement go.   Unprefixed "URL" should be reserved for the value type that can actually work as a canonical API.
>> 
>> +1.  I was pretty shocked by that sentence as well.  The intention to canonize reference types just because they already exist could not be INVHO further from the right intention for Swift.  I understand and accept the short-term rationale for leveraging them.  I do not understand why we would settle for them as the long-term canonical solution.
>> 
> 
> Foundation is not a short term library. The reason we put it into Swift core libraries is because we intend for it to provide the most commonly needed functionality in one well-known, well-maintained place.

I don’t think anyone is thinking of Foundation as a short term library. I do think, though, that a lot of people will be disappointed if there is not a fairly short term plan to introduce types with value semantics into Foundation that would supersede some of the existing reference types. If that is going to happen, dropping NS would seem to complicate that significantly.

—CK

> Dropping the NS is one part of how we intend to make Foundation a great part of Swift. We are working on other ways as well.
> 
> - Tony
> 
>>> 
>>> It's not clear to me if Foundation will actually be in a position to provide that API (e.g. in Swift 4, etc.) or whether some third party will provide a "URL" framework that gains traction first.  But in any case, we are not going to do it in the Swift 3 window, unless a lot of core scope decisions get re-decided.
>>> 
>>> 
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

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


More information about the swift-evolution mailing list