 |
 |
A Cocoa Virtual Machine
|
 |
|
 |
|
Junior Member
Join Date: Dec 2000
Location: Houston, TX, USA
Status:
Offline
|
|
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
|
|
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
|
|
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?
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Sep 2000
Status:
Offline
|
|
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
|
|
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
|
|
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.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|