Does a newly produced mac application need to support 10.4, and can I both support 10.4 and prepare for 64bit? - cocoa

My company is in the process of rewriting our software from scratch, and I'm the one who is going to be doing most of the work in rewriting the Mac client (The core of our software is Windows based, and the Mac client communicates with it through a webservice).
This isn't a real heavy app, mainly does some background work tracking stuff and a UI component for the user to enter information.
I'm trying to decide how hard I should argue for dropping support for 10.4 and going with pure 10.5+/Obj-C 2.0 code.
My main motivations for this are:
It would be easier to code, I could use all the features of Obj-C 2.0 such as synthesized properties and fast enumeration.
It would give me access to several classes, and methods in existing classes, that don't exist in 10.4 (Just in mocking up a UI I've come across NSPathControl and NSTreeNode, both of which I would otherwise be very happy to use.
Preparing for the conversion to 64 bit coming in Snow Leopard. It seems like most of the techniques for preparing for the move to 64 bit (NSInteger, etc) are only available in 10.5+, and it would not be possible to use these if writing for 10.4.
The downside would of course be that we'd no longer be supporting an operating system that was only a year out of date.
My boss is himself supportive of this move, but of course has our customers to consider and doesn't want to cause any more issues for them than are justified. The director of support would like to support 10.4. I suspect the other execs will be marginally against it at first, just due to the not being able to support some customers thing. Everybody would be open to persuasion by a good argument from either side.
I'm trying to talk to some of the support people and get an idea of how many of our customers are actually still using 10.4, but I don't have that data yet.
Some kind of hybrid solution might be possible, such as rewriting parts of the old client to use the new webservice, or writing the client in 10.5 and backporting it to 10.4 if enough people made a fuss, but quite frankly those sound like they're likely to be even more trouble than giving up the 10.5 features and writing the code in 10.4 to begin with.
So I guess my questions are as follows:
Given the information above, do you think making a case for the adoption of 10.5+ only is the right thing to do? Do you have any suggestions as to how this might be presented positively to the rest of the company?
I don't know as much about the coming 64 bit transition as I'd like. Does anybody have any good references on what will be different, and do you think that supporting only 10.5+ would make this transition easier for us?

If it were I doing the update, I would target 10.5, especially since 10.6 is just around the corner and 10.5 did come out with a lot of great, new things (especially Objective-c 2.0). However, I think you really need to answer this question based on what you think your target customer group will be using. If they are slow to adopt new technology, it may be that you have to support 10.4 or risk losing a portion of your customer base.
On the other hand, you can actually target 10.4 and write using the 10.5 SDK. That way you can take advantage of all the preparations for 64-bit added to the SDK. You just have to ensure that you don't use any classes or features of the frameworks that didn't exist in 10.4. You can also do weak linking to the 10.5 frameworks and programatically decide whether you can use a new feature or not (while this is a bit of extra work up front, you can easily phase 10.4 support out of your code in the future and take full advantage of 10.5 improvements for users that actually are running 10.5).
There are a lot of blogs and write-ups about doing the cross-platform stuff out on the web. The other thing to keep in mind is that if you do target 10.4 make sure you have a 10.4 machine available to do a lot of testing (especially if you compile from the 10.5 SDK to take advantage of the 64-bit ready features). Also check the docks for any feature you may want to use from the 10.5 SDK. Many features were actually available in 10.4 but undocumented and the new documentation usually states which features you can safely use when deploying to 10.4

Do you need 64-bit? Unless your application is very CPU-intensive, it won't make any difference.
Tiger can run 64-bit applications, but without GUI. If you need 64-bit, you can create 64-bit CLI executable that does heavy lifting and provide 32-bit font-end for it (using NSTask and NSPipe).
You can also have separate .nib files for Leopard and Tiger:
-(id)init
{
BOOL tiger = floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4;
NSString nibname = (tiger ? #"WindowTiger" : #"WindowLeopard");
if (self = [super initWithWindowNibName:nibname])
…

You really need to find out what your customers are using, and the support person is probably best positioned to know, or the product manager. That said there's nothing wrong with making the technical arguments clear now even if 90%+ of your user base were pre-Leopard; that way the issues will be known (and hopefully understood) so you'll have more support as the environment does change.

I never wrote production code in Objective-C and its hard to keep up, but as far as i am aware NSInteger and friends are in 10.4, it's just that Cocoa isn't 64 bit in 10.4 whereas in 10.5 most of it is (so no more need for seperate 64bit worker process under a 32bit UI).
I don't know what your product is, or who your customers are, but from my experience, Mac users are early adopters (relatively speaking) I've never used an OS X version longer than two weeks before the next upgrade was out, and in my circle I am a late adopter. Ofcourse I'm not just a business Mac user and that may well make a big difference.
What makes 64bits a requirement in your code? There's not much of a reason to not compile a universal binary holding as many architectures as you wish you could have one binary run on G4, G5, IA32 and IA64 no problem, and have it be native on all of them. If you're just doing 64bits because you can there's no reason (that I can imagine) not to keep supporting 32bits, but if you want stuff like CoreAnimation you don't have much choice.
I don't think it's wrong to demand 10.5 for new development, but it wouldn't make much business sense to force a whole new OS on customers just to keep using your existing product. So if you can, stay compatible, maybe backport your new features/patches for a time. There is a good reason for forking in version control and this might be it.
edit-
Since I posted this I learned that I was wrong and NSInteger did not exist before 10.5. I think I assumed too much having used similar types (like NSDecimal) earlier.

Related

Keeping legacy Carbon code alive

Apple has killed Carbon for 64 bit applications. I've got a pile of legacy code that targets carbon UI widgets that I'd like to keep alive for a while. Most of it is in the form of plugins and bundles that will have to go 64-bit in sync with their host platform.
The choice that Apple seems to be assuming is to throw all the legacy code away
and rewrite using Cocoa. It's not going to happen in the short run, if only because
the same legacy code is tied to a PC binding as well.
I'm considering 3 Options
(1) Dive into cocoa, create a compatibility package that supports the small subset
of carbon that I actually need.
(2) use Cocoatron as the new target. In the short run bridge carbon-to-cocotron, and maybe in the longer run convert to cocoatron native for both mac and pc. (ref: http://cocotron.org/)
(3) use QT as the new target. See option (2). (ref: http://qt.nokia.com/)
What I would really prefer is a fourth option, such as a bootleg copy of the 64 bit
Carbon beta that Apple killed, or a compatibility package explicitly intended just
to emulate carbon.
I would recommend you choose option 1. Creating a Cocoa UI wrapper for your code will likely not be as complex as you think. A common way to create a cross-platform app is to create the bulk of the app in cross-platform C++ and use Cocoa/Objective-C++ for the Mac UI and one of the Windows APIs for the Windows UI.
This option also has the advantage that it is fully supported by Apple and the APIs are stable and mature.
Cocotron is a nice idea but as of now it's not mature enough (in my opinion) to provide a robust cross-platform solution. I know there are successes with it but the sample size is small.
Qt is an option. However, it suffers from a very un-Mac-like UI. Using a Qt app on the Mac always feels like a quick port rather than a native app, and this is unlikely to ever change.
The "bootleg Carbon runtime" is just a fantasy, there is simply no way to get that working reliably and absolutely no chance to distribute it. You will need to find another way.

Moving from Windows API to Mac OS

I'm a Windows (native, not .NET) programmer and I'd like to port an application to the Mac.
Actually, I believe it will be more of a rewrite, as the original depends on many activex controls.
As I have never used a Mac in my entire life, I'll need some guidance. O:-)
a) What book(s) would you recommend to make the move from Win32 to Mac OS?
b) Is there anything similar to Delphi (RAD) for the Mac?
c) Can anyone recommend (or not) Lispworks (www.lispworks.com)?
d) Is there anything similar to the Windows market of 3rd party COM components (so I don't have to write everything)?
e) Anything else I should be aware of the Mac market?
f) Oh, BTW, what Mac should I buy? O:-) (must be a laptop)
Thanks in advance
I've taught Cocoa programming to several Windows-experienced programmers. You may find a previous post on the subject useful.
Cocoa is a very different way of thinking then MFC and its kin. You will do much, much better if you take the time to learn how Cocoa approaches things and adapt to its mindset rather than trying to find the quickest way to implement your current way of thinking in ObjC. It is possible to write MFC-style code for Mac, but you will always be fighting the framework if you do. I've seen a lot of Windows developers struggle with this.
The best book to learn Cocoa is Cocoa Programming for Mac OS X. Assuming you are a C++ developer with a solid OOP background, this is the book to start with. If you have limited Object Oriented background, then start with Programming Objective-C 2.0.
You would be amazed how fast Objective-C can be to code once you understand the patterns. It really can be stunning compared to C++ in my experience. There are more RAD-like systems like REALbasic, and you can develop Cocoa apps in Ruby now which can be a bit quicker. But there really is no substitute in the Mac market for ObjC. It's hard to make an app that works like a Mac app without using the Mac frameworks, and Mac users tend to be much fussier about such things than Windows users.
I have no background in LispWorks, but LISP seems a terrible language for developing the kind of rich UIs that Mac apps are known for. I like LISP (quite a lot actually), but Functional Programming's "no side effects" philosophy seems at odds with most rich UI goals (especially as the Mac UI becomes more and more animation-centric). If anything, Mac programming is moving towards Declarative rather than Functional programming (Core Animation and Grand Central Dispatch have a lot of Declarative concepts creeping in).
There is not as large a third-party component market as there is for Windows. Some of this is because Cocoa already provides such a rich set of components, which MFC does not, and because well-behaved Mac apps are expected to use those components so that you work like all other Mac apps. There is definitely little market for commercial components in the vein of RadControls for .NET (very nice toolkit, that one). But there are quite a few nice free components out there with flexible licenses (generally MIT-based). A few of my favorites:
Positive Spin Media's excellent tabbar control
OmniGroup's frameworks (though I never use them "as is;" they're better used as examples of how to do things)
Growl
Sparkle
RegexKit
CocoaDev's ObjectLibrary list of other stuff
As I mentioned before, Mac users are picky about their UI. Much, much more so than Windows users. They expect things to be polished, and they expect things to integrate with all the little things that make Macs nice. That means drag-and-drop, Spotlight, services, Applescript, Expose, QuickLook, integrated spelling check, etc. etc. It's very hard to do all these things right if you don't use the built-in frameworks. That's why I recommend new Mac developers start at the beginning and learn the frameworks.
For a Mac, if you have a bunch of hardware lying around (like keyboards and monitors), then a Mac Mini is a nice cheap box. iMacs are great if you want an all-in-one, and any MacBook is appropriate if you like portability. There is no Mac on the market today that is not a perfectly fine development box. Obviously if you do a lot of work, an 8-core Mac Pro makes compiling much faster, but I've done a lot of professional development on a 13" MacBook. If you want to get in as cheaply as possible, look for refurbished or used (I love my refurbished Mac Mini). Any Intel-based Mac is going to be fine for development, at least while you're getting started.
If you are familiar with C, you may want to learn Objective C since that is the Macs "native" programming language. It's also what you have to use to write iPhone applications. Cocoa is Apple's primary API that will have a lot of the tools you are looking for.
a) Read this thread for book recommendations: https://stackoverflow.com/questions/7571/cocoa-and-objective-c-resources
b) Apple makes Xcode for developing in. There are certainly better ones out there, but it's not bad.
d) Cocoa is Apple's main API, which provides "core" services like CFNetwork for networking. There is also core data, core audio, core animation, core image, core location,... Underneath it all, OSX is Unix, so you have access to many unix/linux libs.
e) The iPhone is a big part of the Mac market. The iPhone and OSX development environments are not that different, so you can learn both.
f) Any Mac is sufficient for most development. If you want a laptop, it's really a question of screen size and price. But I would recommend at least a 15 inch screen. You don't need to spend extra for a faster CPU, but you may want to get a larger hard drive.
If you've done your native Windows programming in C and/or C++, you may have an easier time migrating your application to C#/.Net, and then running it in Mac using Mono. At least some of the available third-party .Net components will run on Mono (see http://www.mono-project.com/Third_Party_Controls_Status).
I have no idea what Mac you should buy - I recommend getting one of the pretty ones.
a) ...
b) You could use Python coupled with wxPython and be cross platform. Python is included by default with Mac OS X.
c) ...
d) I'm sure there is, but I can't tell you more. If you use Python, you get tons of third party libraries for free.
e) They don't take kindly alien GUI guidelines:
Word 6.0, launched in 1993, is widely considered to be the worst version of Word ever for the Mac, as it was based on the same codebase as Word 6.0 for Windows. That meant that it looked and worked more like Windows software than a Macintosh program. Mac users were so up in arms that Microsoft actually released a Word 5.1 downgrade to unhappy Word 6.0 owners.
f) Mostly any iMac will be good enough for programming. Choose the one that you like the most and has lots of RAM.
e) Its a small market.
f) An iMac. Edit: since it says laptop - Macbook Pro 13 is a great deal.

osx & windows development -- for newbies

my background: i've been developing web applications using php and javascript for the past ten years. before that, i've developed applications using turbo pascal for DOS. in my opinion application and web application development are two different kinds of development (at least it's what i think when i remember back the old days of DOS application development).
now i am in the need to go back to "normal" application development for various reasons. the application i want to build needs a GUI and it has to run on osx and windows. as mac os user it would be very nice for me to get an application as result, that really feels like an osx application. i don't need any special UI components: an explorer/finder like tree, a datagrid and some form-elements would be enough for my needs.
now the problem is, that i don't know where to start: i would classify me as newbie, because it's that long time since i last developed anything other than a web application. are there any recommendations of programming languages and gui toolkits with a not to steep learning curve? or can you recommend any book i should read for getting into cross-plattform osx/windows app development?
many thanks!
thanks everyone! i think i'll have a look at realbasic!
Edit Nov 2011 - a retraction
Most of what I say below is still true however I have now got serious reservations about recommending REALbasic for anyone trying to release commercial-quality applications. To save me remembering to edit this post later, see if RealSoftware have managed to release a robust version of their IDE using the Cocoa version of their frameworks. If not, be very cautious.
It's with a heavy heart that I write this because I still really like the language and think the framework and IDE are well-done. The problem is apparently one of under-capitalization and possibly a software development culture inside the company that consistently fails to deal with a bug regression problem. Many bugs are fixed each release but there appears to be a huge tax on the developers in the number of introduced bugs. They have a very small team for the complexity of the product, especially considering the newly released Web Edition which is effectively an entirely new platform.
It's still theoretically a great product but take advantage of the trial period, test it thoroughly on each of the platforms you plan to target and decide if you can live with any bugs you find because they may be there for a while.
REALbasic.
The language is a powerful, modern OO language that won't be hard for you to adapt to from your vaguely remembered Pascal or current JavaScript. It has most of the power of C++ without the dangerous bits that make debugging a nightmare. You will also find the IDE simpler and easier to deal with than say Visual Studio.
The IDE makes it very easy to throw together a GUI and have it just work on multiple platforms. The Pro version has one of the best cross-platform debuggers I've used and it is easy to just work (say) on a Mac and develop for Windows and Linux, compiling and testing with one click.
There is also a thriving community including many people at your level of expertise so you won't be mocked for being a newbie.
I am a professional software developer with over 25 years experience and currently mainly working in REALbasic, C++, C#, Objective-C and a bit of Ruby. For apps such as you mention, REALbasic is my tool of choice.
edit: I can't believe someone downvoted this but didn't have the guts to add a comment explaining why. I'd heard about prejudice against REALbasic but this is the first time I've encountered it. In what way was my answer inappropriate for this question?
Just to add to my cred, I've implemented cross-platform frameworks used by systems deployed to tens of thousands of end users - I have the C++ cross-platform experience to applaud someone else doing a good job and the REALbasic frameworks are very nice.
The best cross-platform tool I've dabbled in with a relatively small learning curve...especially if you're familiar with Visual Basic...is REALbasic. With REALbasic Pro you can compile a program to target Win32, Linux, and OS X from the same codebase, as long as you're not using OS-specific calls and features (which you can do with plugins or direct calls). Their support has been pretty responsive to my questions, the personal edition (which compiles to only the single target platform you'd downloaded the IDE for) is free for Linux and inexpensive for other platforms, but really you might want to download and try it out. One IDE, relatively inexpensive, and can compile native applications on OS X, Windows, and Linux...it's less hassle, and for me that's important when you want to get a job done.
I'd advise against C and Qt and would also recommend REALbasic.
With your background in Pascal and probably JavaScript you'll feel much more comfortable with REALbasic. I've done a lot of coding in Pascal and C/C++ - where Pascal guides you to avoid programming mistakes, C lets you step right in, even invites you, and then you'll have a hard time figuring out why it went wrong. Qt is a very abstract framework and requires you to learn a lot before you can get something working, just like with C. When compared to the easyness we used to have with TP back then.
RB is much more like Pascal in this regard. And its IDE is quite modern in regards to supporting your programming, with an easy-to-use GUI designer, straight-forward editor to fill in the gaps for handling UI events, code completion, etc.
Only when you get into huge program sizes, RB loses some of its appeal because it is missing tools to give you a good overview of complex class interactions etc.
Another thing is that Qt is more likely to cause ugly-looking Mac apps than RB would. RB visually guides you to get it all aligned nicely - in Qt you have to work with numbers, offsets, etc. to position your objects (at least it was that way when I used Qt 2 years ago).
I've written quite a few x-platform apps in RB and am pretty happy with the results.
You won't probably write those super-nice looking apps that compete with the best on the open small business market, but if you just want to get some solid code working, with an easy-to-design UI that's acceptable to the average user, give RB a try.
It's not free, though. But its rather small community is on your side - they're eager to help, instead of bashing everyone who's trying to talk sense :)
I'm new here but picked up on this thread through the REALbasic User Group. I think my position was similar to yours. I did website design for my work, using mostly javascript (with a little php, not much). I had a Pascal and BASIC background. I'd dabbled it C but didn't like the level of detail you needed to monitor it. It reminded me too much of assembly (which I still have nightmares about from my high-school/college days).
I was looking for a cross-platform language, with a familiar feel to it, but initially started with VB because it was free. I prefer programming in MacOS however, so I tried REALbasic. I found that REALbasic's UI builder was much easier to use than VB's. I'd echo other comments that the community is the most responsive of any user groups I've been involved with. I've since used REALbasic and my Mac to make several programs that over 100 users use every day at my work (on PCs, mostly XP and 2000). I've received compliments on the polish and ease of use of these programs. You DO have to remember to adjust the 'little' things to make it look right cross platform (ie: default button placement is opposite on PC vs. Mac, button sizes are different on Linux, etc). Many people have donated custom classes that do this stuff for you though.
People seem to assume that a "BASIC" language cannot be powerful enough for their purposes. While it is BASIC at it's core (with For..Next, Do..While, and If..Then commands), it ain't your daddy's BASIC. It's much more OOP than anything else I've used, based upon an event-driven structure, which for me was easy to pick up. They have a free trial, so grab a demo and run through the tutorial. If you get stuck, ask for questions on the NUG or Forums at the website and you'll likely get an answer quickly.
You may be interested in the following questions and answers:
Cross-platform development - Go with a cross-platform UI toolkit or native on multiple platforms?
Easiest cross platform widget toolkit?
Should I use a cross-platform GUI-toolkit or rely on the native ones?
Using a Mac for cross platform development?
and many others suggested in the Related sidebar of these questions.
Some answers suggest gtk (which is used by cross-platform gimp). Others suggest native approaches. Some suggest that a Mac is a nice platform for developing for Mac OS X, Windows, Unix and Linux.
I wholeheartedly recommend RealBasic too. I have been using RB for about 8 years now and find it to be a perfect tool for my Companies development needs, from small apps, to large multi-user systems.
It is perfect for beginners and those that are getting back into programming, and also for professional developers.
Highly recommended.
As Andy Dent and others here have indicated, for a newbie to create cross-platform applications it is hard to beat REALbasic (now Xojo).
Sure, there are plenty of other cross platform solutions such as QT (C++), Java, .NET (to some extent) and wxWidgets but they are not something a beginner would be able to use effectively.
I have many years of professional development experience in a wide variety of languages and technologies and I prefer to use REALbasic most of the time.
With that said, you might also consider Runtime Revolution or Adobe Air.
Whilst it might seem tempting to use a language thats platform independent and allow you to write the app once and use anywhere, you will undoubtably be sacrificing something on each, particularly in the UI and user experience.
If you can your best creating something using a native API that lets you take full advantage of the features of the OS to make your application shine.
I would definitely go for C++ and Qt, the code you write once will compile and run without problems on Windows, Mac and Linux. The new IDE that comes with Qt - Qt Creator is brilliant, works and looks the same on Windows, Mac and Linux, you don't need to anything else to start writing cross-platform applications.
I tried WxWidgets but didn't find good IDE, the best one was Code Blocks but GUI Designer is not perfect and has different problems on different systems and the IDE itself is still under heavy development.
Other options are Java and C# but those are not cross-platform languages, those are platforms themselves. Although you wouldn't need to compile code for each platform there will a lot of different issues on the way...
If your GUI's simple enough, why not just create a generic GUI layer, then program to that? Compile a version for each OS using native widgets. That's the best way to ensure native L&F on multiple platforms.
Both the Qt and REALbasic suggestions are good, although they tie you to that particular technology (which I can't imagine would be an issue in this particular case).
Personally, I'd go with Java, because it's worked for me before (I had an app that ran on my PDA, my phone and my desktop), but it doesn't use native widgets.
Adding a late comment here:
Take a look at Revolution. It's sort of like a modern Hyper-card on roids. And it's cross platform (Mac, Linux and Windows). This is a serious competitor to RealBasic and is coming on strong. Though I still use RB (and like it) I'm giving Revolution a serious look at.
I would also look into either Realbasic or Revolution. They both create cross platform native apps. Personally I think Realbasic would be a better choice as it is very similar, language wise, to VB. You can learn some valuable skills with RB and it can grow with your experience. I have been using VB and RB for more then 10 years combined and I think you will be happy.
If you need your code to be cross platform, you would have to go with something like QT.
Although, I would recommend using native API for each one (Cocoa for Mac OS X, .NET or the Win32 API for Windows). User experience will be much better. But of course, that will cost you more money in terms of developers hours.

What are the relative merits of wxHaskell and Gtk2HS?

Which is better for developing GUI applications with Haskell, wxWidgets (via wxHaskell) or GTK (via Gtk2HS)?
What are the pros and cons of each? Does it vary depending on which platform you are targeting (I would primarily be working on OS X but would like my programs to work on Linux and Windows too)?
[Disclaimer: I am a wxHaskell maintainer]
Both are stable and fairly complete GUI bindings, and you could choose either for most projects with confidence. Both have some degree of 'higher-level' Haskell bindings, but in both cases you will need to drop into rather imperative 'C' style coding to get things done. My impression is that wxHaskell allows you to spend a little more time in the higher-level bindings, but I've not done much GTK2HS, and in any event, you definitely find yourself working on the thin end of the wrapper for both libraries - and I think the overall programming 'complexity' is similar in both cases.
Therefore, let's take the basic functionality as a given and concentrate on the differences. Please note that I genuinely believe that GTK2HS is an excellent piece of work, and that you will be happy if you choose it. Most of what I say below is a personal take on the differences, and why I choose to work on and with wxHaskell myself.
GTK2HS has a larger team working on it, and is released more regularly. wxHaskell is not updated as frequently, but the core team is active, and there are regular bugfixes, but with major new functionality being added rather more slowly than we would like (we all have day jobs).
wxHaskell gives true native application appearance on all supported platforms out of the box. GTK2HS is, of course, native on Linux and has a pretty good native theme on Windows (i.e. good enough to satisfy all but pedants...), but has GTK look and feel on OSX, and depends on having X11 installed. I believe that an OSX 'native' GTK library is under development, but is considered relatively immature. Once this is stable, GTK2HS should be able to easily benefit from the same 'partially native' look and feel (e.g. GTK OSX screenshot).
wxHaskell is probably a little easier to build if you are not on Linux (GTK2HS is likely easier if you are Linux hosted), but both are pretty complex to build, to be honest, as there are a significant number of dependencies in both cases.
It is slightly easier (IMHO) to distribute applications based on wxHaskell, simply because it has fewer library dependencies. I distribute applications using mainly InnoSetup on Windows, and as App bundles on OSX. I would admit that with only a small amount of extra work, the same could be done with GTK2HS, so this is probably the weakest argument in favour of wxHaskell.
It is my personal opinion that wxHaskell is friendlier to closed source (e.g. commercial) developments. This is, of course, the subject of interminable flame wars, so I will only say that wxHaskell is under the wxWidgets license which unambiguously allows for closed source development. GTK2HS is LGPL, so you'll need to ask your lawyer - although I must make it clear that many people and companies have concluded that LGPL is compatible with commercial development; the lawyers at the company I work for have concluded that it is inappropriate for our projects.
I think that if Linux was my main development and delivery platform, I'd probably use GTK2HS. It isn't, however: I deliver mainly to Windows with occasional OSX, and I think wxHaskell is a better match to these platforms, although both options support all three platforms.
I hope this will help you with your choice.
A consideration is that currently it is slightly easier to get wxHaskell to work natively on Mac OS X. GTK2HS depends on GTK, which does have an implementation using native widgets on Mac OS X, but that implementation is not as easily built as the wxWidgets implementation for Mac OS X is.
Therefore, if you want to develop code to run without X11.app, currently you are slightly better off with wxHaskell.
Note however that this is quickly changing:
http://www.haskell.org/haskellwiki/Gtk2Hs#Using_the_GTK.2B_OS_X_Framework
shows how to use GTK2HS with native GTK+ on Mac OS X.
One advantage of GTK2HS is its GLADE support, making the development of simple UI very quick. The higher level combinators in wxHaskell mitigate most of that advantage, but they do require a deeper understanding of how you want your interface to look and behave, and therefore are harder to use in an exploratory fashion.
I have pretty incomplete information, but since you have no answers yet, maybe incomplete information is better than none.
The question to ask is this: is the toolkit just a wrapper around C-like functionality, or is there an additional layer that gives the toolkit a more "native Haskell-like" API? When wxHaskell was first announced at the Haskell workshop, the development of the native Haskell API looked extremely promising, but was still incomplete. It looks as if the "Haskellized" API for wxHaskell is still being worked on, whereas the Gtk2Hs project doesn't mention this issue at all. For that reason I'd recommend wxHaskell.
Personally I would look into some sort of Reactive package/extension. It seems to sit with the paradigm much much closer. Instead of specifying your graphical stuff imperatively, you can do it declaratively. Example (not representative of any particular language or implementation):
x, y, z :: Int
click, buttonclicked :: Bool
x = <X coordinate of mouse>
y = <Y coordinate of mouse>
click = <Whether mouse button is currently being pressed>
z = x + y
buttonclicked = (x == 10 && y == 10 && click)
Buttonclicked and z will be automatically updated every time x and y change.
You could then have some logic somewhere that looks something like this:
if buttonclicked then <do something> else <do something else>
This is all very fuzzy though. Just look into some real reactive interfaces

How hard is it to get a Cocoa application to run on Windows?

In the wikipedia article on Cocoa it says:
There are also open source implementations of major parts of the Cocoa framework that allows cross-platform (including Microsoft Windows) Cocoa application development, such as GNUstep, Cappuccino, and Cocotron.
Yet when I looked into whether Mac application Tweetie was available for windows the developer had ruled it out:
Windows doesn't have Cocoa, the programming environment that Tweetie is made in, as such, it seems like a poor possibility.
I'd like to have an answer to point the Tweetie developers (and as a resource for other cocoa developers) which would tell them:
Which implementation is the most suitable for getting a cocoa app running on windows?
How much work is it likely to take to get the app running under windows?
How easy/hard is it to maintain a common code base for Mac and Windows?
(any other considerations I've missed?)
Of course if it would be too much work I'd like to know that too before suggesting it and potentially sending someone else on a fruitless search.
Don't forget:
“Major parts of the Cocoa frameworks” is not the same as “the entirety of the Cocoa frameworks”. Tweetie could be using something that's missing.
Tweetie could be (very probably is) using APIs from the non-Cocoa frameworks, such as Core Foundation, Core Services, Core Graphics, and Core Animation. A port of the Cocoa frameworks alone won't include any of these APIs, and even a more complete Mac-API-emulation framework will not include all of them.
These frameworks are eternally chasing Apple. Even if they catch up, they'll be instantly behind again as of the next Mac OS X release. Mac developers already put off using new APIs in new Mac OS X releases while they wait for users to upgrade to those new releases; now you're asking atebits to also wait for the other-framework developer to catch up to Apple again.
Any second implementation of an existing API will have bugs that the first implementation doesn't, and vice versa. These differences will cause development and support problems.
You're asking atebits to add a third platform to an application that already exists on two. Supporting one platform is a lot of work. Supporting two platforms is a hell of a lot of work. Supporting three? Now you're getting into big-company territory.
So, even with these Cocoa-like frameworks, the answer is: Hard.
Among GNUstep, Cappuccino and Cocotron, Cocotron is only possible choice to port a Mac application to windows.
Cappuccino is for web and GNUstep only runs on top of cygwin or mingw, which means the GUI looks nothing like native windows apps.
It is theoretically possible to build cocoa windows apps using Cocotron. However, the reality is that it is still very hard to use, and it is still quite limited in the Cocoa API.
Therefore, two possible solutions:
Try hard to remove the codes that are not supported by Cocotron in the original code base and do the cross compilation. Maintaining common code base will be painful.
Start a new GUI at all, no common code base. two choices here
Start a cross platform project with cross application framework such as Qt, or Java.
Start a windows only project. There are a lot of choices here, .Net WinForm application, MFC, etc.
There are Windows compilers for Objective-C (the programming language used to write cocoa apps). However, Cocoa includes the frameworks for presenting the GUI. These visual frameworks are specific to Mac OS X because they use OS X only windows and other controls. So someone would need to re-implement the controls in Cocoa to use Windows controls.
Also, I am fairly certain that Tweetie uses Mac OS X only technologies like Core Animation. This does not exist on Windows, so the nice animation effects present in the apps would have to be implemented in a completely different way.

Resources