Skip to Content

Cocotron: bringing Cocoa to Windows

Cocotron is a potentially exciting open-source project that "aims to implement a cross-platform Objective-C API similar to that described by Apple Inc.'s Cocoa documentation." What this means is that, in principle, Cocotron would allow an OS X Cocoa app written in Xcode to be easily cross-compiled for other OSes, particularly Windows.

Of course that in principle still leaves open a bunch of practical difficulties. The guys over at Magnetism Studio (developer of FileMagnet for iPhone) have a great account of how they used Cocotron to port their Mac FileMagnet Uploader to Windows. Of course it wasn't as easy as pressing a button and having a Windows executable pop out of Xcode, but after suitable adjustments (particularly to get rid of Mac-specific code) it did make a Windows version possible. In any case, Cocotron seems poised to make cross-platform development a much less costly and time-consuming process for Mac developers.

Cocotron itself is a free download and released under the MIT license.

[via Daring Fireball]

Categories

Open Source Developer

Cocotron is a potentially exciting open-source project that "aims to implement a cross-platform Objective-C API similar to that described...
 

Add a Comment

*0 / 3000 Character Maximum

20 Comments

Filter by:
guy@shaviv.org

I wonder if someone will take a spin on cocotron and try to use it to port cocoa touch from the iphone to android. Now that would be a killer...

October 30 2008 at 9:28 AM Report abuse rate up rate down Reply
1 reply to guy@shaviv.org's comment
Nick P.

...Except that Android uses Java, which syntax stands somewhere between C++ and Obective-C. This would require a new Cocotron-like project to convert Objective-C to Java and then port Cocoa.

There's a better chance for Qt pull this off since their approach is to code with teir own API while they do the translation to various systems.

- Nick -
www.songhacker.com

October 30 2008 at 11:55 AM Report abuse rate up rate down Reply
Greg

Apple needs to push for projects like this, it's the best way to get people developing for the Mac OS platform.


http://gregstechblog.blogspot.com

October 29 2008 at 11:14 AM Report abuse rate up rate down Reply
1 reply to Greg's comment
Nick P.

Greg,

The best thing Apple ever did to bring in more Mac developers was making Cocoa Touch *the* API for developing for the iPhone. I don't know a single developer who doesn't want to learn Objective-C now.

Apple is better focusing on advancing the state of Cocoa/Cocoa Touch than trying to be compatible with whatever Microsoft is doing. Microsoft is sure as hell not doing it.

- Nick -

October 29 2008 at 4:25 PM Report abuse rate up rate down Reply
Nick P.

UI-wise, Cocotron is very different from GNUStep. On Window, a Cocotron program uses native Windows Widgets while a GNUStep program will use GDI (non-accelerated drawing) to draw it's own NextStep-style widgets.

There are many ways to port an application and the Cocotron approach provides native Windows look and feel using Cocoa-compatible code.

Personally, I think that no matter what you do, you still have to learn the Windows and Cocoa APIs to get the best UI. Cocotron will save you time if you are writing an app that uses standard Cocoa widgets. Apps that use custom widgets (Delicious Library, Screenflow, etc.) will require knowing both APIs by heart.

BTW, iTune is "tour de force" because it does a lot of CoreAnimation/CoreImage stuff without Cocoa.

- Nick -

October 29 2008 at 10:17 AM Report abuse rate up rate down Reply
Kelmon

I like the principals of cross-platform applications but am very much opposed to them in practice. The problem always tends to be the "lowest common denominator" issue whereby you can't implement something that isn't available on all platforms. Mac-specific features/functions are what make Mac applications special. Apple has provided a rich and wonderful suite of services and frameworks that should be taken advantage of to make the applications that we love. Firefox is a wonderful example of this. It's a great application but it just doesn't support those things that we expect on a Mac, such as storing your passwords in Keychain. I don't mind, however, having a cross-platform core (e.g. Gecko used in Camino) as long as it is then wrapped in a true native application.

October 29 2008 at 7:49 AM Report abuse rate up rate down Reply
Will

Or you could just use Qt, or WxWidgets, or even XUL.

October 29 2008 at 6:59 AM Report abuse rate up rate down Reply
1 reply to Will's comment
Nick

None of which play well with Cocoa. None of which will allow you to create a 64 bit Mac application. None of which play well with extended Mac controls.

Qt is especially ugly, XUL is completely non compliant /and/ slow as a UI handler.

October 29 2008 at 10:37 AM Report abuse rate up rate down Reply
Jash Sayani

So just like CrossOver Mac, we could run OS X apps on Windows... Or do we need to compile those apps in a special compiler..?

October 29 2008 at 6:43 AM Report abuse rate up rate down Reply
john

As developers become more reliant on Apple's Core services, I think this whole cross-platform developing dream is going to die out. It will just be too difficult to be worth it. In a few years, the browser will unify all the platforms anyway as it seems we're moving closer and closer to a sad web app future.

October 29 2008 at 1:31 AM Report abuse rate up rate down Reply
1 reply to john's comment
Level 5

For consumers, yes. For instance, my sister, grandparents, girlfriend, etc. etc. all the way down the line use their computers for only the following

- Web Browsing
- E-Mail (which can be done via web)
- Music (ripping, syncing with the PMP of their choice)
- MS Office or iWork

This is all. For most of them, a Mac Mini, eMachine or most any netbook would handle their every need.

For a professional like myself or most of TUAW's readers, this isn't the case, and not only do we need cross-platform applications, we need multiple operating systems if we can't get them! How many Intel Mac professional users either dual-boot with XP, use EFit for Leo/XP/Linux, or use Fusion or Parallels? Sadly we're in the minority.

October 29 2008 at 6:40 AM Report abuse rate up rate down Reply
Level 5

I'm really hoping in a twisted way that this will make for a much better Windows version of iTunes to replace the atrocity Win users have to deal with now.

October 28 2008 at 10:34 PM Report abuse rate up rate down Reply
1 reply to Level 5's comment
Vega

Only problem being that iTunes is a Carbon, not a Cocoa application.

It still gives you these nice retro touches like the small b/w watch symbol mouse pointer whenever the app is busy...

October 29 2008 at 6:43 AM Report abuse rate up rate down Reply
Uwe

Funny. We are currently successfully experimenting to bring our Windows based .NET client for our uploading service "Zeta Uploader" - http://www.zeta-uploader.com - to OS X with the help of the newly released Mono from Novell.

Still some minor glitches, but in principal it is working. Great stuff, too!

October 28 2008 at 5:27 PM Report abuse rate up rate down Reply
samrolken

How is this any different or better than GNUstep, which has been around longer and is more cross-platform?

I like seeing Cocoatron supporting more of the Core* frameworks needed by modern Mac OS X applications, even if it only works on Windows.

Having open-source versions of these libraries would mean more commercial and open-source software for Linux. The Linux desktop crowd is heavily involved with Wine(lib) and Mono to bring Windows apps to Linux. Why no similar effort for Mac OS X apps?

October 28 2008 at 3:57 PM Report abuse rate up rate down Reply
3 replies to samrolken's comment
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.