I have been busy the latest days experimenting the usage of the libffi library inside RubyCocoa. If you don't know about libffi, it's a library part of the GCC project to call arbitrary C functions at runtime, stacking the parameters for you depending on their type and the architecture. The PyObjC project is using it since years, so there was no reason why we shouldn't :)
My work is visible in the libffi-experiment branch. libffi is used to callback C functions from Ruby, and to forward messages from Ruby to Objective-C. The latter is important, as we replaced the previous NSInvocation-based mechanism (that creates and sends several Objective-C objects and messages) by this pure-C library. And we don't even use objc_msgSend[v], we directly retrieve the IMP function pointer and branch it through libffi, as we don't care anymore about argument types. This is great for performances, I will do some serious benchmarking in the very near future and post the results.
On another note, this branch has some preliminary work about a more dynamic bringing idea. Instead of generating static code for all the non-introspectable stuff (C functions, constants, enums...) at build time, an XML file that describes all these details is instead produced (one per framework), and RubyCocoa at runtime parses them and do the necessary linkage. Symbols are lazily localized (at demand). This way is more dynamic, as you don't have to rebuild RubyCocoa each time you want to support a new framework, or when an already-supported framework changed. A tool has been written to generate the XML metadata, and you can use it to support your own framework.
Very exciting stuff in the RubyCocoa land in perspective...