Objective-C portability
Objective-C portability
- Subject: Objective-C portability
- From: Marcel Weiher <email@hidden>
- Date: Thu, 14 Mar 2002 16:37:36 +0100
Hi folks,
the question of portability comes up from time to time. Some more
real-world info: TextLightning has just been ported to Linux, using
libFoundation.
Overall, the port went fairly smoothly, only taking a couple of days
(after MPWFoundation had been ported earlier, so some of the issues are
known). It required a substantial Objective-C code-base to be ported,
including the PDF-interpreter (and PS-Interpreter it is based on), a
graphical object-model and various support classes, totaling around
40-50 KLOC.
Some of the biggest headaches were a somewhat buggy gcc, no Objective-C
support in the installed gdb and sometimes somewhat strange
exception-handling. The first two could probably have been fixed by
installing newer and/or more appropriate versions, but one headache at a
time.
The GNUStep build-system also takes a while to untangle for someone used
to Project Builder. There are still some things I still do by hand, but
now that things are working, I will be doing some cleanup. Promise ;-)
Another thing to watch out for is that GNUStep doesn't seem to support
frameworks in the sense of linked library + resources. Bundles with
resources are supported, but mean dynamically loading the code. I now
look for resources in a specific location, but that isn't quite optimal
yet.
libFoundation was very nice overall, although it is possible to find a
bug occasionally, and some things aren't complete. The unicode
handling, for examplem, doesn't actually seem to handle non-8 bit
characters, at least I just got an exception stating the same (worked
around it for this application). It would be interesting to see how it
compares with gstep-base in this regard.
One thing that paid off very well was the strict separation I keep
between AppKit and non-AppKit code. If you want portability, I strongly
suggest you also do this! Keep your core functionality in a framework
(or frameworks) that link only against Foundation and only include the
Foundation headers. If certain classes need to interact with AppKit,
keep that interaction in a category and move those categories (and
additional classes) in a separate framework.
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.