Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Desh

macrumors newbie
Original poster
Jan 24, 2006
4
0
Hi,

I've heard much about iWork, being the Carbon-AppleWorks replacement. However, I tried it out recently, and it really felt like Cocoa, smooth and nice. Just for fun, I tried "otool -L path-to-pages" and discovered that it is indeed a Carbon application. Surprise. Does this mean that Carbon and Cocoa is as good as equal in these days? Becase I really can't tell from its interface!

Any thoughts?

The thing is that I perfer C++ to ObjC, but I've disliked Carbon since Apple made it a second class citizen! But since Pages feel just like Cocoa, and intergrates very good into Keynote (which is Cocoa) I've got new hope for Carbon! Why can't they just be one?
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
Apple never made Carbon a second class citizen and Carbon and Cocoa need each other to exist. For a long time, they've used parts of each other to do what they need to do.

There are quite a few more Carbon applications than Cocoa applications, in any case, including those from Apple.

The only reason I see Carbon getting a bad reputation is because of poor conversions done by companies like Adobe who are in the spotlight. It's obvious that conversions to Cocoa are going to be potentially better because a lot of re-engineering has to be done, whereas only a few tweaks will allow a Carbon application to run. In fact, AppleWorks is such a Carbon application.
 

Desh

macrumors newbie
Original poster
Jan 24, 2006
4
0
But still...

Cocoa is OS X only, and Carbon is cross-platform. I've noticed how much slower Carbon apps are compared to Classic apps in OS 9, not only because they were re-engineered. Even brand new Carbon apps doesn't feel as snappy as Classic apps.

Further, OS X only Carbon apps still doesn't feel as fast as Cocoa apps, even though the C/C++ language should make them faster compared to ObjC. I suspect this is since Carbon is required to operate both on a non-threaded enviornment such as OS9, and multithreaded. Further, it need UI wrappers to adopt itself to OS9/OSX.

I which we could get a OSX only Carbon, or a C++ Cocoa. OS X and it's apps really needs to get snappier...
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
I think Pages is Cocoa. I have just installed an iWork '05 trial and got this from otool -L:

Code:
jay:/Applications/iWork/Pages.app/Contents/MacOS robbie$ otool -L Pages 
Pages:
        /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 743.24.0)
        /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 19.0.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 299.31.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 500.56.0)
        /System/Library/Frameworks/AddressBook.framework/Versions/A/AddressBook (compatibility version 1.0.0, current version 321.0.0)
        /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 84.6.0)
        @executable_path/../Frameworks/SFStyles.framework/Versions/A/SFStyles (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFUtility.framework/Versions/A/SFUtility (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFDrawables.framework/Versions/A/SFDrawables (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFWordProcessing.framework/Versions/A/SFWordProcessing (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFControls.framework/Versions/A/SFControls (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFArchiving.framework/Versions/A/SFArchiving (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/libiconv.framework/Versions/1.8/libiconv (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/libxml.framework/Versions/2.6.6/libxml (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFRendering.framework/Versions/A/SFRendering (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFProofReader.framework/Versions/A/SFProofReader (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFTables.framework/Versions/A/SFTables (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFPartitions.framework/Versions/A/SFPartitions (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
        @executable_path/../Frameworks/SFInspectors.framework/Versions/A/SFInspectors (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFCharts.framework/Versions/A/SFCharts (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFMovie.framework/Versions/A/SFMovie (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFAnimation.framework/Versions/A/SFAnimation (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/Dennis.framework/Versions/A/Dennis (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/MediaBrowser.framework/Versions/A/MediaBrowser (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFLicense.framework/Versions/A/SFLicense (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 71.1.1)

Not the first one: AppKit. That's Cocoa. Yes it links to Carbon but this will be for stuff that is not yet in Cocoa. 99% of the app is Cocoa. Some of my Cocoa apps link to Carbon but all the important bits are Cocoa.

Further proof can be found in the Info.plist file (snipped):
Code:
        <key>NSMainNibFile</key>
        <string>Pages</string>
        <key>NSPrincipalClass</key>
        <string>SLApplication</string>

These keys are not found in Carbon apps (check iTunes for example).
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
Desh said:
Cocoa is OS X only, and Carbon is cross-platform. I've noticed how much slower Carbon apps are compared to Classic apps in OS 9, not only because they were re-engineered. Even brand new Carbon apps doesn't feel as snappy as Classic apps.

Further, OS X only Carbon apps still doesn't feel as fast as Cocoa apps, even though the C/C++ language should make them faster compared to ObjC. I suspect this is since Carbon is required to operate both on a non-threaded enviornment such as OS9, and multithreaded. Further, it need UI wrappers to adopt itself to OS9/OSX.

I which we could get a OSX only Carbon, or a C++ Cocoa. OS X and it's apps really needs to get snappier...

It depends on which events mechanism the Carbon applications are using. Carbon events is compatible with Mac OS 8.6 but runs poorly on Mac OS 8.6-9.2.2 and runs well on Mac OS X. On the other hand, System 6 events are Carbon-compatible but run poorly on Mac OS X. That's part of the reason there are two executables for AppleWorks. It's also the reason WebStar for Mac OS 9.x stopped being a Carbon application. It was too slow.

Carbon applications that co-exist in one executable don't run well on both operating systems.
 

Desh

macrumors newbie
Original poster
Jan 24, 2006
4
0
It isn't linked to Cocoa...

I understand what you say, but still, it isn't linked to Cocoa. AppKit and Nib-files can be used by Carbon too, i think.

robbieduncan said:
I think Pages is Cocoa. I have just installed an iWork '05 trial and got this from otool -L:

Code:
jay:/Applications/iWork/Pages.app/Contents/MacOS robbie$ otool -L Pages 
Pages:
        /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 743.24.0)
        /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 19.0.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 299.31.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 500.56.0)
        /System/Library/Frameworks/AddressBook.framework/Versions/A/AddressBook (compatibility version 1.0.0, current version 321.0.0)
        /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 84.6.0)
        @executable_path/../Frameworks/SFStyles.framework/Versions/A/SFStyles (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFUtility.framework/Versions/A/SFUtility (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFDrawables.framework/Versions/A/SFDrawables (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFWordProcessing.framework/Versions/A/SFWordProcessing (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFControls.framework/Versions/A/SFControls (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFArchiving.framework/Versions/A/SFArchiving (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/libiconv.framework/Versions/1.8/libiconv (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/libxml.framework/Versions/2.6.6/libxml (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFRendering.framework/Versions/A/SFRendering (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFProofReader.framework/Versions/A/SFProofReader (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFTables.framework/Versions/A/SFTables (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFPartitions.framework/Versions/A/SFPartitions (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
        @executable_path/../Frameworks/SFInspectors.framework/Versions/A/SFInspectors (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFCharts.framework/Versions/A/SFCharts (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFMovie.framework/Versions/A/SFMovie (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFAnimation.framework/Versions/A/SFAnimation (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/Dennis.framework/Versions/A/Dennis (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/MediaBrowser.framework/Versions/A/MediaBrowser (compatibility version 1.0.0, current version 1.0.0)
        @executable_path/../Frameworks/SFLicense.framework/Versions/A/SFLicense (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 71.1.1)

Not the first one: AppKit. That's Cocoa. Yes it links to Carbon but this will be for stuff that is not yet in Cocoa. 99% of the app is Cocoa. Some of my Cocoa apps link to Carbon but all the important bits are Cocoa.

Further proof can be found in the Info.plist file (snipped):
Code:
        <key>NSMainNibFile</key>
        <string>Pages</string>
        <key>NSPrincipalClass</key>
        <string>SLApplication</string>

These keys are not found in Carbon apps (check iTunes for example).
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Desh said:
I understand what you say, but still, it isn't linked to Cocoa. AppKit and Nib-files can be used by Carbon too, i think.

There is no Cocoa.framework. Cocoa is made up of two frameworks Foundation.framwork and AppKit.frawework. As you can clearly see Pages is linked agains these.

Carbon apps can use Nibs but use the HIToolbox as opposed to the AppKit.

Pages is Cocoa.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.