Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > A Cocoa Virtual Machine

A Cocoa Virtual Machine
Thread Tools
Junior Member
Join Date: Dec 2000
Location: Houston, TX, USA
Status: Offline
Reply With Quote
Mar 8, 2001, 08:27 PM
 
Hello!
I have a question about Cocoa...is there any reason why a Cocoa virtual machine could not be created for Windows or Linux? Since Cocoa is a layer on top of some more fundamental frameworks and libraries, couldn't this be implemented somehow? Is Java so different from Cocoa that Cocoa can't have its own VM? Is it a matter otf developer interest and support, or are there some fundamental problems with this approach? Just a thought....
Mike
     
Mac Enthusiast
Join Date: Jan 2001
Status: Offline
Reply With Quote
Mar 8, 2001, 11:20 PM
 
the problem with that is, that if you implement it as a virtual machine, that would mean it would have to be interpreted, making it DOG SLOW. no Developers would have any interest in it.
But apple did work on it for a while, i beleive it was called yellow box, but i dont know what happened to it...
     
Junior Member
Join Date: Dec 2000
Location: Houston, TX, USA
Status: Offline
Reply With Quote
Mar 9, 2001, 12:04 AM
 
The only reason i mention it is because i see several people around saying Cocoa won't amount to much b/c its not cross platform. However, i don't see people complaining much about Java (i could be wrong), and the fact that its interpreted. So it seems to me that a Cocoa virtual machine would be no different than the JVM. What would it take to build a Cocoa virtual machine?
     
ali
Forum Regular
Join Date: Sep 2000
Status: Offline
Reply With Quote
Mar 9, 2001, 12:32 AM
 
Most of Cocoa is implemented in C or Objective-C; you really would not want to interpret that, unlike Java, whose "bytecodes" are designed for interpreting.

However, as 00101001 says, earlier version of Cocoa ("Yellow Box") was available on Windows, and the C and Objective-C code in that version was simply recompiled for Windows. In addition, some services (such as the windowserver, mach messaging, etc) were also ported to Windows; for other services (printing, interaction with Explorer, etc) YellowBox used existing Windows APIs.

Applications written in Objective-C ran on YellowBox for Windows with a simple recompile.

So, there isn't a technical issue preventing cross-platform Cocoa apps...

Ali
     
Dedicated MacNNer
Join Date: Oct 2000
Location: Pasadena, CA, USA
Status: Offline
Reply With Quote
Mar 9, 2001, 11:34 AM
 
No, there is no reason why Cocoa could not be ported to Windows or Linux - ancestral versions of Cocoa (called OpenStep) were ported to several operating systems, including Windows NT and Solaris. There is also an OpenStep clone called GNUStep available now for Linux and other Unix-like operating systems. However, you can't just take an OpenStep application compiled for one platorm, move the binaries over to another platform and execute it. Even under the best circumstances it is necessary to re-compile the binary for the target machine. Recompiling an OpenStep application for a new architecture is mostly a trivial process, but still an additional step.

The situation is quite different with Java. Source code is compiled into a intermediate format (called bytecode), which is then interpreted by the virtual machine. Modern virtual machines will go the extra step of compiling bytecode into regular binary format, which can significantly improve performance. One of the big benefits of compiling to bytecode is that it is possible to move a compiled Java application from one platform to another without recompiling - I do it all the time at work.

     
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status: Offline
Reply With Quote
Mar 9, 2001, 01:09 PM
 
I think Cocoa is in a very good place for cross-platform development. While the compiled program has to be native, the packages let a single Application (ie, a folder called something.app) contain binaries for as many platforms as you want.

MyApplication.app
..Contents
....Resources <-- folder of platform-independent stuff
....Mac OS <-- folder for OS X binaries

To which you just add:

....Yellow Box <-- folder for Windows binaries
....Alpha <-- in case Apple chooses another chip line

All words are lies. Including these ones.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:32 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2