From: Chris Thomas Date: 2002-01-15T03:14:12+09:00 Subject: Re: [OT] Question about RubyCocoa and GnuStep On 1/10/02 8:16 PM, "Chris Gehlker" wrote: > On 1/10/02 2:50 PM, "Chris Thomas" wrote: > >>>> So, my question is: Could RubyCocoa be used under GnuStep on Linux? >>>> I suspect that the answer is no right now, >> >> In theory, it's possible to do this, but it would be a significant amount of >> work with things as they stand. >> >> The big technical problem (assuming that GNUstep perfectly replicates the >> Cocoa API, which I'm pretty sure it doesn't currently) is that the GNU >> Objective-C runtime and the NeXT Objective-C runtime -- although >> conceptually related -- are completely different in both API and >> implementation. > > I think this overstates. Foundation pretty much works. At least my code > works. AppKit has a long way to go. But the GNUStep folks express a desire > to close the gap in their mission statement. Of course the fact that > Foundation works is big deal for ObjC programmers and probably a don't care > for ruby programmers. I should be a little more clear. The Objective-C runtime library is the support code for manipulating the underlying data structures that support the dynamism of the Objective-C language, the class definition hierarchy and such. NeXT had an Objective-C runtime library (which Apple continues to maintain), but -- for reasons unknown to me -- did not donate it to the FSF along with the Objective-C compiler. There is an entirely different GNU Objective-C library for use on non-Mac OS X platforms; it is conceptually similar, but different in API and implementation from the NeXT-derived library. >> I suspect you'll need to wait until GNUstep's interface is a bit closer to >> Cocoa, though. > > It seems to depend. Apple claims in one of their tech notes that Cocoa is an > extension to the OpenStep API rather than a replacement for it and code that > conforms strictly to the OpenStep API should port. Some of the folks on the > Mac oriented lists, particularly Cocoa Dev, have asserted that this is > mostly true. I'm not an expert on the provenance of Cocoa, so I'll accept that. :) >> (BTW, A "fat binary" in Mac OS X parlance is a binary archive that contains >> one Mach-O file for each CPU architecture that the developer wants to >> support. Linux uses ELF executables, not Mach-O, so fat binary support is >> not helpful for this purpose.) > > This may be getting OT for a Ruby list but I find it really interesting. I > don't understand ELF but I've been told it's very close to PEF which is > supported in MOSX through a vector library. Wouldn't the same technique work > for ELF? How did OPENSTEP support multiple executable formats? To the best of my knowledge, OpenStep did not support multiple executable formats. PEF applications are supported on Mac OS X through a command-line tool called LaunchCFMApp that understands the PEF file format and sets up the vector libraries (every function called from a PEF app must transition through vector glue to translate it into a Mach-O call). ELF applications could theoretically be supported the same way, but that would require someone to do the work of creating a LaunchELFApp tool and related stuff to translate ELF to Mach-O. PEF shared libraries are not directly accessible from Mach-O code, and neither would ELF libraries be. Chris