This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ObjC runtimes (was Re: objc gnu runtime losage)



> > Why do we have two ObjC runtimes, anyway?  Is there a good reason to
> > prefer one over the other?

the license is different, which might be a very good reason to choose one
over the other.

the GNU runtime can be compiled to run with support for garbage
collecting, while the Apple runtime can not.

one very notable difference from the application writer point of view is
that the GNU runtime is very slow in class method invocations.  I have
completely rewritten the GNU runtime class lookup to address this problem
(and also submitted the patch) but then got busy into rewriting
gnustep-make and never had the time to double check and commit it ... for
which I feel very guilty ... now I nearly finished with gnustep-make so I
promise to get back to work on the GNU runtime to finish my work soon.

technically, there are many other differences in the internals ...
completely different code bases .... but the API and the behaviour is very
similar, even if different in a way to make it incompatible ... also, the
GNU runtime uses a different naming scheme in the API than the Apple one
(so the same function doing the same thing has normally a different name)
...

most application code does not need to access the runtime directly, or if
it does it, it does it through an additional layer (FoundationKit on
Apple, gnustep-base on GNU) which is completely standardized, so most
application code is immediately portable from one runtime to the other
one, and the different underlying runtime API doesn't affect it.

but ... the additional layer does not provide an interface to all the
available features and internals of the runtime, but only to part of them,
so some code (typically interfaces to other languages, eg in gnustep the
gnustep-guile interface or the gnustep-java interface, or the gnustep-ruby
interface) must access the runtime directly (typically to dynamically
register new methods or classes) - that code might be very difficult to
port - it's bound to one runtime and won't even compile (or sometimes even
make sense) on the other one.

as Stan says, it's a result of politics and conflicts of years ago ... the
situation (with Apple and GNU cooperating) seems very different now ... I
think it would be very good for both to standardize the API or perhaps
even to merge the runtimes ...  but it's still very difficult to
standardize the API, because half of the ObjC world is using one API, and
the other one is using the other one ... and about merging, well, the
licenses are different.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]