[Mono-list] Windows.Forms on OSX

John Vaudin john@vaudin.net
Wed, 17 Apr 2002 00:17:02 +0100


Greg Brown wrote: 
> On Windows, .NET is implemented on top of the Win32 API. Similarly, I would
> guess that much of Cocoa is implemented on top of Carbon.

No. Cocoa is a completely different thing. MacOS X grew out of NeXTStep
which was based on Mach and BSD. Cocoa is essentially the NextStep APIs
(you'll see everything is called NSThis and NSThat) and runs directly on
Mach and Quartz, which is Apple's display PDF implementation that grew out
of NextStep's display Postscripts stuff.

Carbon is a MacOS compatibility API that was added to NextStep to make it
easier to port existing MacOS software. It sits alongside Cocoa, and if
anything it runs on Cocoa rather than the other way around as it talks to
Quartz rather than the MacOS Toolbox.

In terms of functionality Carbon is analogous to Win32 API whereas Cocoa is
more like the .NET framework - its a huge class library.

> somewhere that there is nothing you can do in Cocoa that you can't do in
> Carbon. 

I'm not sure that is true, but the two APIs are so different it is not easy
to say. 

> Cocoa just makes some tasks easier. It seems like it would be worth
> at least considering using Carbon to implement Windows.Forms, since
> Windows.Forms is a higher level abstraction, and you want as much
> flexibility from the lower layers as possible.

I would tend to agree with this. Cocoa provides a lot of functionality, but
if the fit is not exact between Cocoa and Windows.Forms, which seems very
likely, then it could easily get in your way. Carbon gives you less, but
probably won't get in your way.

Using carbon would also allow Mono to run on MacOS 8.x/9.x. Very few of the
Mac users I know have 'upgraded' to OS X (me included). If I want UNIX I'll
use LINUX. If I want to use MacOS I want real MacOS, not a UNIX
implementation with a MacOS emulator bolted on. Maybe OS X will take off,
maybe it won't I don't know. Using Carbon isolates Mono from that issue,
Using Cocoa ties you to OS X, and Apple has plenty of previous for dropping
technologies that didn't catch on.

-- 
John Vaudin