-
Notifications
You must be signed in to change notification settings - Fork 69
Objective C Bridge
There is the start of an Objective C bridge available.
Notably, it lacks support for objc_msgSend
.
We need a design for how this should work, preferably informed by other implementations. Some Common Lisp implementations have Objective C bridges and may be a good place to look.
In Dylan, this may require some compiler support, similar to direct-c-ffi
or the higher level c-ffi
.
We should be able to have melange
read in BridgeSupport files and generate the appropriate bindings as defined in interface files like we do for C APIs.
The Objective C 2.0 runtime provides enough support to allow Dylan programs to create new subclasses of Objective C classes as well as to expose new method implementations.
We will need compiler support to do this correctly, but some invocations of objc_msgSend
could, in fact, become invocations of the objc_msgSend_vtable*
functions. The code generated should actually be using objc_msgSend_fixup
in this situation to enable this optimization within the Objective C run-time.
For details, see `[objc explain]: objc_msgSend_vtable`_ by Greg Parker.