With regards to being able to call a Swift function from C, stevetrewick pointed me to @_cdecl early last year[0][1][2]:<p><pre><code> @_cdecl("foobar") public func foobar() {}
</code></pre>
I haven't yet used it in anger, but that will compile in Swift 3.<p>[0]<a href="https://news.ycombinator.com/item?id=11650628" rel="nofollow">https://news.ycombinator.com/item?id=11650628</a><p>[1]<a href="https://github.com/apple/swift/commit/013aad13d4245a012cfb762b7edccf92013b3609" rel="nofollow">https://github.com/apple/swift/commit/013aad13d4245a012cfb76...</a><p>[2]<a href="https://swiftlang.ng.bluemix.net/#/repl/d68be430e72609717f718006aa0ae137eae872ca7a0b7e8141b351770b0c9eac" rel="nofollow">https://swiftlang.ng.bluemix.net/#/repl/d68be430e72609717f71...</a>
Pretty cool stuff. Too bad it's not available under an Open Source license. That kind of severely limits who can use it and what they can use it for. :-(