Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Objective-C 2.0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C 2.0

On Aug 8, 2006, at 1:39 PM, Greg Hurrell wrote:

El 07/08/2006, a las 22:09, Dietmar Planitzer escribió:

There are a ton of highly interesting things there. I like all of them - but my personal favorit is the AGC stuff.

Could you comment a bit more about that? What are some of the highly interesting things in there. I've looked at the CVS repository but I don't know enough to really interpret what's in there that's going to benefit me; from my perspective as an Objective-C user (not a compiler hacker).

Jason has already listed some of those features (method attributes, agc, properties). Now a disclaimer, before we go further:

Everything that I say below is only and exclusively gathered from the GPL sources in the public gcc repository, publicly available Apple documentation and publicly available Apple source code. The gcc sources have been accessible to the public for at least 3/4 of a year now (that's when I first stumbled over them). However, whether those sources represent the gcc specific bits of ObjC 2.0 or not is something that must be left to the realm of speculation as the sources nowhere mention that name. Further, the greater goal of some of the changes that can be found in the sources can not be satisfactorily explained without access to the missing pieces of the puzzle, namely the corresponding ObjC runtime and Foundation framework. Since those components are not publicly accessible, we can only speculate about the purpose of those changes.

Now what can be seen there ?

A complete new ABI that seems to organize the runtime data structures in a more efficient way. There is more that could be said about this, but as mentioned above, figuring out what the exact purpose of each and every of the many changes is without access to the corresponding runtime is wild guessing in the dark.

Support for automatic garbage collection. The gcc man page that comes with Xcode 2.2+ has a description of how this feature can be enabled and how it basically works. The GC uses write barriers for it's implementation and seems to support a generational collection algorithm (see /usr/include/objc/objc-auto.h on a Tiger system with Xcode 2.2+ installed). Looking at the sources of the current Tiger ObjC runtime (objc-274, available from Apple's open source page) it seems that the AGC can be enabled/disabled on a per-application basis. I.e. application A can run with the AGC, application B can run with reference counting instead. By the way, the AGC has been shipping with every copy of Tiger for a year now. Look into /usr/lib/ libauto.dylib.

A faster message dispatching mechanism. How it works, I've forgotten by now :)

As Jason already mentioned: properties aka auto-generated getters/ setters. Looks like that you are able to specify the behavior of the getter/setter. I.e. should it reference a passed in object or should it copy it.

Another thing is a thing to iterate over those things called collections aka foreach().

There are probably other things that I've overlooked or forgotten. But those things would in my opinion already make ObjC a much more powerful language than what we have today. Assuming that they find their way into a shipping version of Mac OS X.


Dietmar Planitzer

Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

 >Objective-C 2.0 (From: "Philippe C.D. Robert" <email@hidden>)
 >Re: Objective-C 2.0 (From: Dietmar Planitzer <email@hidden>)
 >Re: Objective-C 2.0 (From: Greg Hurrell <email@hidden>)

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.