Introducing "Deobjectivizer"


I've been working on a secret Clang-based project for a while, and now
I'm ready to share it with the world.

Introducing the "Deobjectivizer".

This is a program that scans framework bundle headers for Objective-C
constructs, and generates procedural C wrappers around them, so you can
call them from C. It uses Clang's libraries to parse, analyze, and
rewrite Objective-C headers into pure C headers, and then generate
corresponding source files containing the wrapper implementations. The
implementation of this tool is a little hackish at the moment, but it
suffices to generate a wrapper around the entire Foundation framework
(at least).

Using this program, developers no longer have to use Objective-C to
develop for Cocoa*. Projects like Wine that don't allow Objective-C can
use Cocoa anyway. iOS developers can write their programs in a language
other than Objective-C.

I've attached the source so you can play with my newest creation. At the
moment, it can only be built on Mac OS X (only one of two platforms, the
other being iOS, where a program like this makes sense anyway). Feel
free to make changes; the sources are licensed under the same license as
Clang itself.

Comments welcome. What do you think?


deobjectivizer.tar.gz (26.9 KB)


My name is Jonathan Barronville. I am a young developer residing in Boston,
MA. I just came up to this message on the mailing list and I am interested
in using your program. Can you please help me out by telling how to start
using it. I already downloaded it.
Thanks in advance!

- Jonathan

This looks awesome. I'm working on a similar tool but it translate the Objective-C headers to D instead of C.