[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is Swift Bridge Possible?
- From: Eric Wing <ewmailing@...>
- Date: Thu, 26 Jan 2017 12:14:05 -0800
Hi, I’m the author of LuaCocoa. I thought I would chime in.
So Swift is currently a very compile-time oriented language. I haven’t
done a deep dive into pushing on the dynamic side of Swift yet
(because it is still a little wild-wild-west on even just the
traditional C/static-side interoperability where I am spending my
time), but my overall impression is that building a bridge like
LuaCocoa out of Swift isn’t going to be viable (assuming no ‘cheating’
by calling the Objective-C runtime).
Within the Cocoa community, some prominent veterans have raised
concerns about the lack of dynamic features in Swift because there are
certain features and patterns in Cocoa that are easy to implement in
Obj-C, but very hard in Swift. The Swift development team has
responded (on the Swift mailing list) that they are interested in
solving these problems, but are not there yet. It is a combination of
trying to implement these features that makes sense for the Swift
language as a whole, as well as priorities. The people who need
dynamic features are mostly framework authors, and actually a niche
within that group. And since Swift doesn’t even have a stable ABI yet,
there aren’t a lot of framework authors, so you might imagine that
priorities are focused on other things.
If you wanted to do a Swift-Lua bridge today, I would imagine you
would have to do it like the C++ bridges of today, i.e. relying on
code generation and generics to create the bridging at compile time.
-Eric