[swift-evolution] [swift-evolution-announce] [Review] SE-0161: Smart KeyPaths: Better Key-Value Coding for Swift
jordan_rose at apple.com
Mon Apr 3 13:55:15 CDT 2017
[Proposal: https://github.com/apple/swift-evolution/blob/master/proposals/0161-key-paths.md <https://github.com/apple/swift-evolution/blob/master/proposals/0161-key-paths.md>]
Hi, David, Michael, Joe. I'm sorry to admit I haven't been keeping up with all the discussion on this proposal, but I do want to ask a very important implementation question: how will key paths be represented? Specifically, I'm concerned about it possibly using reflection metadata, which contributes to both code size bloat and secrecy leaks. (Imagine the metadata for a property 'shouldConnectToDishwasherOSDevice" appearing in a new build of the iOS simulator.)
I can imagine a very simple but inefficient implementation strategy that's based around something like closures, and a more efficient one that would directly code-generate offsets for structs (and use symbolic offsets when doing cross-module generation). Both of these would sidestep the use of reflection metadata. Is that more what you were thinking?
(sorry for opening the Pandora's Box of "I should be able to introspect types in the libraries I use" again)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution