Software dvelopment on a Mac

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Jan Brouwer
Posts: 201
Joined: Thu Mar 22, 2007 7:12 pm
Location: Netherlands

Software dvelopment on a Mac

Post by Jan Brouwer »

I have to replace my aging Windows XP laptop, and I'm considering switching to a Mac (specifically the 13 inch MacBook Air).
However, I really like visual studio for C++ development, especially for debugging and single stepping through newly written code.
In the past I very briefly worked with xcode, and it left me a bit confused (not to mention that strange objective C syntax).

So how easy is it to debug with current xcode? Is it comparable to debugging with visual studio or eclipse?
Rein Halbersma
Posts: 741
Joined: Tue May 22, 2007 11:13 am

Re: Software dvelopment on a Mac

Post by Rein Halbersma »

Jan Brouwer wrote:I have to replace my aging Windows XP laptop, and I'm considering switching to a Mac (specifically the 13 inch MacBook Air).
However, I really like visual studio for C++ development, especially for debugging and single stepping through newly written code.
In the past I very briefly worked with xcode, and it left me a bit confused (not to mention that strange objective C syntax).

So how easy is it to debug with current xcode? Is it comparable to debugging with visual studio or eclipse?
Why not use Eclipse + CDT + Intel compiler?
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Software dvelopment on a Mac

Post by JuLieN »

Jan Brouwer wrote:I have to replace my aging Windows XP laptop, and I'm considering switching to a Mac (specifically the 13 inch MacBook Air).
However, I really like visual studio for C++ development, especially for debugging and single stepping through newly written code.
In the past I very briefly worked with xcode, and it left me a bit confused (not to mention that strange objective C syntax).

So how easy is it to debug with current xcode? Is it comparable to debugging with visual studio or eclipse?
You can make projects in C/C++ with Xcode (and even with other languages, like Object Pascal, if you add the required files).

If your Xcode experience is older than a year, forget about it: the new Xcode 4 is very different and very nice to use. I also love the profiling tools that come with it, called "Instruments". That's how one day I discovered that Prédateur used 30% of its time with check detection. Chocking discovery that made me work on it (now it's under 1%).

Take a look at some of the more important novelties here:
http://developer.apple.com/technologies ... s-new.html

Image

As you can see, it's a lot closer to Visual Studio, now.
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
Jan Brouwer
Posts: 201
Joined: Thu Mar 22, 2007 7:12 pm
Location: Netherlands

Re: Software dvelopment on a Mac

Post by Jan Brouwer »

JuLieN wrote:
Jan Brouwer wrote:I have to replace my aging Windows XP laptop, and I'm considering switching to a Mac (specifically the 13 inch MacBook Air).
However, I really like visual studio for C++ development, especially for debugging and single stepping through newly written code.
In the past I very briefly worked with xcode, and it left me a bit confused (not to mention that strange objective C syntax).

So how easy is it to debug with current xcode? Is it comparable to debugging with visual studio or eclipse?
You can make projects in C/C++ with Xcode (and even with other languages, like Object Pascal, if you add the required files).

If your Xcode experience is older than a year, forget about it: the new Xcode 4 is very different and very nice to use. I also love the profiling tools that come with it, called "Instruments". That's how one day I discovered that Prédateur used 30% of its time with check detection. Chocking discovery that made me work on it (now it's under 1%).

Take a look at some of the more important novelties here:
http://developer.apple.com/technologies ... s-new.html

Image

As you can see, it's a lot closer to Visual Studio, now.
Yes, my experience was one and a half year ago, good to hear it has improved since then.
I will look a bit more into xcode 4, thanks!
Jan Brouwer
Posts: 201
Joined: Thu Mar 22, 2007 7:12 pm
Location: Netherlands

Re: Software dvelopment on a Mac

Post by Jan Brouwer »

Rein Halbersma wrote:
Jan Brouwer wrote:I have to replace my aging Windows XP laptop, and I'm considering switching to a Mac (specifically the 13 inch MacBook Air).
However, I really like visual studio for C++ development, especially for debugging and single stepping through newly written code.
In the past I very briefly worked with xcode, and it left me a bit confused (not to mention that strange objective C syntax).

So how easy is it to debug with current xcode? Is it comparable to debugging with visual studio or eclipse?
Why not use Eclipse + CDT + Intel compiler?
I still prefer visual studio over eclipse, but eclipse is also improving (recently switched to eclipse helios at work).
I guess the Intel compiler would be quite expensive for a Mac, but of course you can also use gcc.
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Software dvelopment on a Mac

Post by JuLieN »

Jan Brouwer wrote:
Rein Halbersma wrote:
Jan Brouwer wrote:I have to replace my aging Windows XP laptop, and I'm considering switching to a Mac (specifically the 13 inch MacBook Air).
However, I really like visual studio for C++ development, especially for debugging and single stepping through newly written code.
In the past I very briefly worked with xcode, and it left me a bit confused (not to mention that strange objective C syntax).

So how easy is it to debug with current xcode? Is it comparable to debugging with visual studio or eclipse?
Why not use Eclipse + CDT + Intel compiler?
I still prefer visual studio over eclipse, but eclipse is also improving (recently switched to eclipse helios at work).
I guess the Intel compiler would be quite expensive for a Mac, but of course you can also use gcc.
XCode comes with gcc and LLVM, and Apple strongly hints us to use LLVM, as it produces much faster binaries than gcc (20-50% faster).

This is what Apple says about it, on the link I sent you previously :
Apple LLVM Compiler 2.0
Apple LLVM is the next-generation compiler technology powering Xcode 4. Based on the vibrant open source LLVM.org project led by Apple engineers, the Apple LLVM compiler is modern thinking, tuned for iPhone, iPad, and the multi-core Mac.

Apple LLVM is fast. It compiles code twice as quickly as GCC, yet produces applications that also run faster. The compiler was built from the ground up as a set of highly optimized libraries, easy to extend, easy to optimize, and designed for today’s modern chip architectures. In Xcode 4, the full Apple LLVM compiler stack — from the front end parser, to the back end code optimizer — has great support for C, Objective-C, and C++.

Syntax highlighting, code completion, and every other index-driven feature is handled by the LLVM parser. If the compiler knows about a symbol, so does the Xcode IDE. C, C++, and Objective-C are all accurately understood at editing time, exactly as they are when building.
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
Jan Brouwer
Posts: 201
Joined: Thu Mar 22, 2007 7:12 pm
Location: Netherlands

Re: Software dvelopment on a Mac

Post by Jan Brouwer »

JuLieN wrote: XCode comes with gcc and LLVM, and Apple strongly hints us to use LLVM, as it produces much faster binaries than gcc (20-50% faster).

This is what Apple says about it, on the link I sent you previously :
Apple LLVM Compiler 2.0
Apple LLVM is the next-generation compiler technology powering Xcode 4. Based on the vibrant open source LLVM.org project led by Apple engineers, the Apple LLVM compiler is modern thinking, tuned for iPhone, iPad, and the multi-core Mac.

Apple LLVM is fast. It compiles code twice as quickly as GCC, yet produces applications that also run faster. The compiler was built from the ground up as a set of highly optimized libraries, easy to extend, easy to optimize, and designed for today’s modern chip architectures. In Xcode 4, the full Apple LLVM compiler stack — from the front end parser, to the back end code optimizer — has great support for C, Objective-C, and C++.

Syntax highlighting, code completion, and every other index-driven feature is handled by the LLVM parser. If the compiler knows about a symbol, so does the Xcode IDE. C, C++, and Objective-C are all accurately understood at editing time, exactly as they are when building.
20 to 50% faster seems extreme as gcc is quite close to state of the art if I am not mistaken.
I found the following link link which indicates that generally gcc executables are still slightly faster (although for the case of the crafty part of SPECInt2000 (-O3), LLVM wins).
But from what little I have read so far, LLVM seems definitely the way to go.
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: Software dvelopment on a Mac

Post by JuLieN »

Yes, you'll find benchmarks conforming and denying the speed gain. I guess it depends on each software. That'll be up to you to test what's faster for your programs; the process is very simple: you can select which compiler to use from inside your project's parameters, and change it when you want. :)
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
Rémi Coulom
Posts: 438
Joined: Mon Apr 24, 2006 8:06 pm

Re: Software dvelopment on a Mac

Post by Rémi Coulom »

JuLieN wrote:XCode comes with gcc and LLVM, and Apple strongly hints us to use LLVM, as it produces much faster binaries than gcc (20-50% faster).
In my experience of developing iPhone apps (chess, Othello, and Go), I found that gcc always produces faster code than LLVM.

Rémi
User avatar
Bo Persson
Posts: 243
Joined: Sat Mar 11, 2006 8:31 am
Location: Malmö, Sweden
Full name: Bo Persson

Re: Software dvelopment on a Mac

Post by Bo Persson »

Jan Brouwer wrote:
JuLieN wrote: XCode comes with gcc and LLVM, and Apple strongly hints us to use LLVM, as it produces much faster binaries than gcc (20-50% faster).

This is what Apple says about it, on the link I sent you previously :
Apple LLVM Compiler 2.0
Apple LLVM is the next-generation compiler technology powering Xcode 4. Based on the vibrant open source LLVM.org project led by Apple engineers, the Apple LLVM compiler is modern thinking, tuned for iPhone, iPad, and the multi-core Mac.

Apple LLVM is fast. It compiles code twice as quickly as GCC, yet produces applications that also run faster. The compiler was built from the ground up as a set of highly optimized libraries, easy to extend, easy to optimize, and designed for today’s modern chip architectures. In Xcode 4, the full Apple LLVM compiler stack — from the front end parser, to the back end code optimizer — has great support for C, Objective-C, and C++.

Syntax highlighting, code completion, and every other index-driven feature is handled by the LLVM parser. If the compiler knows about a symbol, so does the Xcode IDE. C, C++, and Objective-C are all accurately understood at editing time, exactly as they are when building.
20 to 50% faster seems extreme as gcc is quite close to state of the art if I am not mistaken.
I found the following link link which indicates that generally gcc executables are still slightly faster (although for the case of the crafty part of SPECInt2000 (-O3), LLVM wins).
But from what little I have read so far, LLVM seems definitely the way to go.
Could be true for the gcc 4.2 Apple delivers.

The newer gcc releases have improved significantly, but also acquired a license Apple doesn't like.