This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PROPOSAL: Objective-C++

[Get raw message]
Ziemowit Laski wrote:

Probably not a tough inference :-), but in case there's any doubt,
I support doing this.

> The Objective-C++ language may be thought of an extension of C++,
> analogously to how Objective-C extends C.  The language was
> originally envisioned as an interface technology, enabling users
> to directly invoke Objective-C APIs (such as NeXTStep/GNUStep, or
> Cocoa on Mac OS X) from C++ code -- and vice versa -- without the
> need for C glue code.  Needless to say, Objective-C++ is extremely
> useful in this regard, allowing developers to port applications
> to Mac OS X (and other platforms with existing Objective-C
> frameworks) with much more ease.

In fact, when I originally heard about Objective-C++, I thought
"geez, another one of those strange Apple ideas".  However,
without it, developers with bodies of Objective-C and C++ code
to integrate have to write and maintain literally hundreds of
shims written in the common subset of C.  While there are some
automated interface generation systems out there, there's nothing
standard and in practice they haven't been that easy to use.

If anybody is wondering about the object models, the best way
to describe them is as "mutually oblivious".  In a sense, the
ObjC and C++ models are interacting only via C-level machinery,
but it's being handled by the compiler, and thus more efficient
all around.

> The good news about adding Objective-C++ to gcc is that
> very little actual new code will be required!  Most of the
> functionality already exists in the cp/ and objc/ folders. :)

Ironically, if the long-term goal of integrating all the C
dialect frontends had been achieved, this would be trivial.
Hey, let's blame Tiemann for making cc1plus be a separate program
instead of a runtime option to cc1... :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]