PDA

View Full Version : 2 easy questions (I hope)




GothicChess.Com
Apr 6, 2007, 06:56 PM
Greetings to everyone,

I've been a Mac programmer since 1984, but had been "out of the game" for a few years, and only started working in XCode a little while ago.

I have 2 short questions.

1. Is the Carbon API going to be supported by XCode for a while, or will we all have to switch to Cocoa and ObjectiveC eventually?

2. I have XCode 1.1 on OS X 10.3.9 running on an old G4 Cube. It seems that the long long data type is not supported (I can't "count" over that 4.2 billion limit of 2^32). Do I need a G5 AND the latest version of XCode to take advantage of this, and, if so, can I still use the Carbon API if I purchase what I need?

The reason I ask is that I want to convert a very cool chess program I wrote for the PC to Mac OS X. This is a new version of chess with two new pieces, an Archbishop that can move like a Bishop or Knight, and a Chancellor that can move like a Rook + Knight.

The program is here: http://www.gothicchess.com/gv_release.html

And the 6'5" tall blonde on the website is not too bad to look at either :)

http://www.gothicchess.com/images/alexis_10.jpg

Thanks in advance for any help



szymczyk
Apr 6, 2007, 10:12 PM
Carbon works on the latest versions of Xcode and Mac OS X. It is not going away any time soon because large companies like Adobe and Microsoft use Carbon to write their Mac apps.

Instead of using the long long data type, try using the Uint64 and Sint64 data types. The Core Services framework has a header file Math64.h that provides support for 64-bit integers. You can use the functions in Math64.h in Carbon, and they work on all versions of Mac OS X so you can still use your Cube.

HiRez
Apr 7, 2007, 12:09 AM
Carbon works on the latest versions of Xcode and Mac OS X. It is not going away any time soon because large companies like Adobe and Microsoft use Carbon to write their Mac apps.Not only that, but most of Cocoa (at least Foundation) is based on Carbon and uses it under the hood. So yeah, it'll be around for awhile. That said, if I were starting a new project right now, I'd write it in Cocoa. While Carbon will still be there, more and more new stuff will be biased towards Cocoa and Objective-C, as will the majority of documentation and code samples as time goes on.

Eraserhead
Apr 7, 2007, 04:14 AM
Carbon is really for cross platform development, if you are going to make your chess program available for the Mac and PC with new releases then it's the best choice for a Mac only program Cocoa is probably better, though as you are porting an application, Carbon might be easier (especially if it is C++ on the PC).

gnasher729
Apr 7, 2007, 07:58 AM
1. Is the Carbon API going to be supported by XCode for a while, or will we all have to switch to Cocoa and ObjectiveC eventually?

2. I have XCode 1.1 on OS X 10.3.9 running on an old G4 Cube. It seems that the long long data type is not supported (I can't "count" over that 4.2 billion limit of 2^32). Do I need a G5 AND the latest version of XCode to take advantage of this, and, if so, can I still use the Carbon API if I purchase what I need?

Carbon is here to stay. What is going to disappear is antique stuff, like Quickdraw (Quartz will give you better results and run much faster anyway), but Carbon will stay and is a fine API.

Eventually you may have to learn a bit of Cocoa and Objective C; some APIs are only available in Cocoa, but they are quite easy to call from C.

XCode 1.1 is absolutely outdated. The current version is 2.4.1 and I would really recommend that you download it. Get yourself a free ADC membership and prepare for a 900 MB download :-) Seriously, you shouldn't be using XCode 1.1 anymore.

Thomas Harte
Apr 7, 2007, 08:15 AM
To add to the comments of the poster above, I believe Xcode 1.5 is the most recent version available for OS X v10.3, and you should probably upgrade to that. Also maybe look into options for getting someone with Xcode 10.4 to build for you at some point otherwise you're not going to get a Universal Binary.

kpua
Apr 7, 2007, 09:04 AM
Not only that, but most of Cocoa (at least Foundation) is based on Carbon and uses it under the hood.

While this is true in several notable cases (for example, the entire event loop structure), I wouldn't go so far to say that most of Foundation is based on Carbon. More correctly, a great deal of both Carbon and Cocoa under OS X share CoreFoundation as their main code base -- that doesn't imply dependence of Cocoa on Carbon.

But regardless, the point is the same. Eliminating Carbon at this point would be very difficult and even detrimental given the major companies who depend on it and the notable cases where Cocoa does depend on Carbon. Carbon is here to stay, I think, until at least OSXI or OSXII or whatever they're going to call it...

thejadedmonkey
Apr 7, 2007, 10:08 AM
And the 6'5" tall blonde on the website is not too bad to look at either :)
She doesn't look 6'5"

GothicChess.Com
Apr 7, 2007, 10:23 AM
She doesn't look 6'5"

Here is a picture from us in Iceland...

The long legs of Alexis (http://www.gothicchess.com/images/alexis_ed_elevator_iceland.jpg)

GothicChess.Com
Apr 7, 2007, 10:29 AM
To add to the comments of the poster above, I believe Xcode 1.5 is the most recent version available for OS X v10.3, and you should probably upgrade to that. Also maybe look into options for getting someone with Xcode 10.4 to build for you at some point otherwise you're not going to get a Universal Binary.

It would be great if XCode contained the same "metaphor" as the Software Update services that are offered, and a menu item allowed it to be downloaded in real time.

I have hunted around for XCode updates, and there was no way that was immediately obvious to me to obtain it.

Someone mentioned getting an ADC membership, I will explore how to do this in the interim.

A heartfelt thanks to everyone who has chimed in to offer advice. It is much appreciated!

johnee
Apr 7, 2007, 10:34 AM
Here is a picture from us in Iceland...

6'5", 6'6", whatever it takes...

GothicChess.Com
Apr 7, 2007, 10:35 AM
Carbon works on the latest versions of Xcode and Mac OS X. It is not going away any time soon because large companies like Adobe and Microsoft use Carbon to write their Mac apps.

Instead of using the long long data type, try using the Uint64 and Sint64 data types. The Core Services framework has a header file Math64.h that provides support for 64-bit integers. You can use the functions in Math64.h in Carbon, and they work on all versions of Mac OS X so you can still use your Cube.

Thanks for the reassurances! I was hoping that Carbon would remain, but I have been "left in the dust" before by "radical" API changes (I was around for the OS 6 to 7 change, which seemed enormous at the time, then OS 9 to OS X made me a "programming dinosaur") so I thought that maybe the hardware switch would trigger even more changes.

The 64-bit integer usage is a major deal, I would not be able to solve larger endgame databases without this. I see now that I had to also switch my options under the "Target" pane to not use the default C compiler settings, which did not include the C90 standard! Now at least I am "somewhat modern" with C99, which does allow the long long.

Again, many thanks!

Eraserhead
Apr 7, 2007, 10:36 AM
Someone mentioned getting an ADC membership, I will explore how to do this in the interim.

You have to be an ADC member to get Xcode updates, but the free membership is fine for this purpose.

GothicChess.Com
Apr 7, 2007, 03:52 PM
Thanks for the tips regarding XCode. I joined ADC and now have the "bleeding edge" version of XCode for 10.3.9 which is version 1.5.

The download is a painless 600 MB with cable modem, ya gotta love it!

gnasher729
Apr 7, 2007, 05:44 PM
Someone mentioned getting an ADC membership, I will explore how to do this in the interim.

In case you are looking for ADC: www.apple.com, click on "Developer" :p

GothicChess.Com
Apr 19, 2007, 03:32 AM
Thanks again to everyone, I am finally using 64-bit long long data types in my program using X Code 1.5 properly, and I have 8,000 lines of code down and cranking more every day!

http://www.onlyperfectcheckers.com/images/OPC_starting_position.jpg