[swift-evolution] [Review] SE-0058: Allow Swift types to provide custom Objective-C representations

Kevin Lundberg kevin at klundberg.com
Tue Apr 5 19:57:55 CDT 2016

Generally I'm +1 on this, but I do have a concern. It's not made
explicit in the proposal, but I presume that this is meant to only be
available on Darwin, and not Linux or other platforms that don't have
swift using the Objective-C runtime? (Please correct me if I am mistaken.)

I ask because of the swift-corelibs-foundation project; Presumably once
that is complete for Swift 3, code that makes use of this type bridging
should be able to be run cross-platform. For example:

var a = [AnyObject]()
(a as NSArray).addObject(NSObject()) // should this work on all platforms?

swift-corelibs-foundation uses its own protocol named
_ObjectTypeBridgeable (defined here:
to simulate what happens today on Darwin platforms, but there is no
language support for it so API consumers must explicitly call its
bridging methods. It would be great if corelibs-foundation (and any code
designed to work on Linux) could take advantage of this proposal to
provide the language support, and if the proposal as written is not
intended to have an effect on Linux at all, then I would suggest we
modify it so that the resulting implementation is not tied to
Objective-C and Darwin only.


On 4/4/2016 1:44 PM, Joe Groff via swift-evolution wrote:
> Hello Swift community,
> The review of “Allow Swift types to provide custom Objective-C
> representations” begins now and runs through April 11, 2016. The
> proposal is available here:
> https://github.com/apple/swift-evolution/blob/master/proposals/0058-objectivecbridgeable.md
> Reviews are an important part of the Swift evolution process. All
> reviews should be sent to the swift-evolution mailing list at
> https://lists.swift.org/mailman/listinfo/swift-evolution
> or, if you would like to keep your feedback private, directly to the
> review manager. When replying, please try to keep the proposal link at
> the top of the message:
> Proposal link:
> https://github.com/apple/swift-evolution/blob/master/proposals/0058-objectivecbridgeable.md
> Reply text
> Other replies
> *What goes into a review?*
> The goal of the review process is to improve the proposal under review
> through constructive criticism and, eventually, determine the
> direction of Swift. When writing your review, here are some questions
> you might want to answer in your review:
> • What is your evaluation of the proposal?
> • Is the problem being addressed significant enough to warrant a
> change to Swift?
> • Does this proposal fit well with the feel and direction of Swift?
> • If you have used other languages or libraries with a similar
> feature, how do you feel that this proposal compares to those?
> • How much effort did you put into your review? A glance, a quick
> reading, or an in-depth study?
> More information about the Swift evolution process is available at
> https://github.com/apple/swift-evolution/blob/master/process.md
> Thank you,
> -Joe
> Review Manager
> _______________________________________________
> 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/20160405/d80e0a81/attachment.html>

More information about the swift-evolution mailing list