[swift-evolution] Python Interop with Swift 4+

Chris Lattner sabre at nondot.org
Fri Dec 1 02:50:33 CST 2017


Here’s an updated version of this: Most importantly, I found through the implementation effort for DynamicMemberLookupProtocol that it is better for PyVal to be a struct than it is for it to be an existential.  This implementation shifts the design to that center of gravity, which makes a lot of things feel more natural:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PythonInterop.playground.zip
Type: application/zip
Size: 26907 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171201/6a2a773e/attachment.zip>
-------------- next part --------------



There are still lots of open design topics: I’ve listed a few at the bottom of the tutorial page.  This playground is tested with unmodified Xcode 9.

-Chris


> On Nov 19, 2017, at 6:16 PM, Chris Lattner <sabre at nondot.org> wrote:
> 
> Hi all,
> 
> As I mentioned on a couple other threads, I’ve been working on improving Swift interoperability with Python.  I have two pitches out: one to improve Python member lookup and one to improve calls to Python values.  While those proposals are important, I think it is also useful to see what can be accomplished with Swift today.
> 
> To show you how far we can get, here is a Swift playground (tested with Xcode 9) that has an example interoperability layer, and a tutorial for using it.  If you’re interested in the pitches, or in Python, please check it out:
> 
> 
> In addition to showing how far the interop can go today (which is really quite far) it shows what the future will look like assuming the member lookup and call issues are resolved.  To reiterate what I said on the pitch threads, I am not attached at all to the details of the two pitches themselves, I simply want the problems they address to be solved.
> 
> Finally, of course I also welcome questions and feedback on the actual approach, naming, and other suggestions to improve the model!  Thanks,
> 
> -Chris
> 



More information about the swift-evolution mailing list