This is the mail archive of the
mailing list for the GCC project.
Re: PROPOSAL: Objective-C++
[Get raw message]
- Subject: Re: PROPOSAL: Objective-C++
- From: Stan Shebs <shebs at apple dot com>
- Date: Tue, 13 Nov 2001 14:40:29 -0800
- Cc: gcc at gcc dot gnu dot org, discuss-gnustep at gnu dot org
- References: <95B641A8-D877-11D5-B680-0030658361CA@apple.com>
Ziemowit Laski wrote:
> PUTTING OBJECTIVE-C++ INTO GCC 3.x
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
> 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... :-)