<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">A somewhat extreme alternative could be the use of IDLs and "libs as services“:<div class=""><br class=""></div><div class="">A Python lib could aditionally expose its APIs (or a relevant subset of it) via an IDL. Generators would help with the necessary stub and skeleton code on both Python and Swift sides.</div><div class=""><br class=""></div><div class="">My impression is that only big libs like TensorFlow are relevant to be bridged anyhow so that the effort to create an IDLized API for that community is acceptable.</div><div class=""><br class=""></div><div class="">IDLs are an old idea but they seem to get reinvented every now and then. Google has a new one called FIDL for its Fuchsia project: (<a href="https://fuchsia.googlesource.com/fidl/" class="">https://fuchsia.googlesource.com/fidl/</a>)</div><div class=""><br class=""></div><div class="">Cheers</div><div class="">Marc</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">Am 01.12.2017 um 17:07 schrieb Jon Gilbert via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""></div><div class="">On Dec 1, 2017, at 02:44, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><br class=""></div><blockquote type="cite" class=""><div class="">So the use case here is, how do we make Swift a viable candidate for doing those things which today drive users to Python? The answer here is _not_: build a better Python. Nor does it require, out of the gate, even being as good as Python. The solution is to provide a _reasonably_ ergonomic to _interoperate with libraries available in Python_, with the benefit that those parts that you can write in native Swift will make the overall result safer and faster, etc.</div></blockquote><br class=""><div class="">I think we would be better served by a transpiler that translates Python (etc.) into Swift at compile time.&nbsp;</div><div class=""><br class=""></div><div class="">Look what Google did with j2objc (<a href="https://github.com/google/j2objc" class="">https://github.com/google/j2objc</a>). It translates Java right into Objective C. You can even put your Java code right in XCode and it auto-translates at build time.&nbsp;</div><div class=""><br class=""></div><div class="">Clearly, this is no small feat, and j2objc is a technical marvel that took world-class engineers years to perfect.&nbsp;</div><div class=""><br class=""></div><div class="">My point is, “Dynamic Member Lookup” is not the only solution, and it’s not the ideal solution if indeed it compromises the static guarantees of Swift.</div><div class=""><br class=""></div><div class="">Therefore, we should consider what other approaches might entail. The main players in Swift have lots of money and technical resources they could pour into a set of revolutionary transpilers.&nbsp;</div><div class=""><br class=""></div><div class="">Surely we don’t want to allow Goole to be the only company to provide a library that translates other codebases directly to a primarily Apple language, do we?</div><div class=""><br class=""></div><div class="">That being said, I am still interested to hear Chris’s response to these concerns, and if they were already addressed on a previous message and I missed that, then please forgive me.</div><div class=""><br class=""></div><div class="">- Jon</div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>