Reputation: 333
I am interested in binding the Cocoa framework from another platform via a scripting language like Ruby, Lua or . I studied various bindings and I can see how the languages bind to the Cocoa API functions but I fail to see how this is actually going to work on the Mac. Is there an extra compilation on the Mac itself necessary or is just the binding with the API itself sufficient to produce a working executable?
Upvotes: 1
Views: 187
Reputation: 3000
Cocoa API is based on Objective-C runtime. Objective-C is a superset of C so its code may have two interfaces: c-like and objc-like. The former is usual, the latter is based on C. There are bunch of C functions in objc runtime, like objc_getClass() and objc_msgSend(). All objc code is converted to these calls and then compiled as if it was regular C. So, binding to objc is binding to these functions.
It is unclear question, probably because of lack of understanding of what's described above. Objc runtime is a regular library, so any "cocoa binding/bridge" is not more complex than any "zlib binding" etc. Once you compiled the generic bridge, it may be used from corresponding language without changes or additional linking.
Upvotes: 1