**************************************** The ObjectiveAmiga package An Objective-C environment for AmigaOS Release 0.1 Copyleft 1994-1995 by Stefan Zeiger **************************************** License ******* ObjectiveAmiga is based on the GNU Objective C runtime system which comes with GNU CC 2.5.8. ObjectiveAmiga is subject to the same license conditions as the GNU CC 2.5.8 Objective C runtime: ObjectiveAmiga is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ObjectiveAmiga is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ObjectiveAmiga; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, if you link this library with files compiled with GCC to produce an executable, this does not cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. Introduction ************ ObjectiveAmiga is a runtime system and class collection for the Objective C language as implemented by gcc 2.5.8. Note that you first have to install gcc 2.5.8 (maybe some earlier versions will work, too) in order to use ObjectiveAmiga. If you should get crashes from `ld', try installing an `ld' from gcc 2.6.0 or later or even better install a full 2.6.0 (or later) system and simply add the 2.5.8 compilers directory. The supplied Makefile will choose gcc 2.5.8, no matter which versions are installed. See below for installation and deinstallation instructions. ObjectiveAmiga consists of 5 parts: * The runtime system (almost completely functional): A standard Objective-C runtime system based on libobjc.a as supplied with gcc 2.5.8 but with some AmigaOS specific modifications. My runtime system also tries to be compatible as far as possible (I can't test it...) with the original gcc, with the NeXTSTEP [2] and in some points with the Stepstone [3] runtime system. Note that not the whole runtime system is indeed contained in `libbjc.a'. More and more parts are being moved over into the shared runtime library `objc.library'. * The shared runtime library (under development; functional): Traditionally Objective C programs carry a huge overhead in their code, due to the big runtime system. ObjectiveAmiga tries to minimize this problem by moving as many as possible parts from the linker library into a shared library which is placed into `libs:' instead of being linked to all executables directly. * The basics library (very rudimentary): A class library loosely based on the basic classes of Stepstone's ICpak101 as described in [3]. This library might depend in some places on my runtime system, but it doesn't make direct use of AmigaOS. Thus it should be portable, at least to some degree. * The AppKit (prepared for implementation): This is currently a linker library because the runtime doesn't yet support dynamic loading of classes. This kit is modeled after the NeXTSTEP AppKit classes with some AmigaOS specific modifications. * The AmigaOS support library (under development; functional): This library tries to encapsulate some AmigaOS functions in Objective C classes. Note that of the above only the runtime system is complete. All other parts are currently very rudimentary and by no means complete. Installation ************ *Installation:* 1. Make sure that you have installed gcc 2.6.0+ and the gcc 2.5.8 executables. 2. CD to the directory where you found this file. 3. Check the paths in the Makefile. 4. Create the runtime system with 'make install'. *Deinstallation:* 1. CD to the directory where you found this file. 2. Type 'make remove'. *Updating:* In order to upate with a new release of ObjectiveAmiga, simply deinstall the old release (see above) and then install the new release from scratch (see above). The directory structures of new releases could change and include files `' are constantly being removed one by one when their functionality is taken over into the runtime library. Thus it would be unwise to install a new release over an existing one. Major changes to libobjc.a compared to the gcc 2.5.8 version ************************************************************ * Changed defintion of BOOL, YES and NO to be compatible with the AmigaOS defintions for boolean values. * Solved naming conflicts with Objective C and BOOPSI. Especially changed `Class' to `OCClass' for compatibility with BOOPSI. `Class' can still be used as long as `' is not included. * Added an NXZone implementation based on memory pools. Note that if you define AMIGAOS_39 in `runtime/Makefile' (this is done by default), `objc.library' requires OS3.0. Undefine AMIGAOS_39 in order to produce an `objc.library' which runs on OS2.04 and above. * Added an NXAtom implementation. Currently the strings are searched directly in the atom list which is not quite fast. I will change this to hash table searching whin I find the time for it. * Added many new methods to Object, mainly in order to be more compatible with NeXTSTEP. Added category `Object (StepstoneArchiving)' for Stepstone-type object archiving functions. This makes sense because there is currently no NXStreams implementation, thus archiving will be used mainly with files (which is easier with the Stepstone methods). * Since the function names of GNU and NeXTSTEP implementations differ although many functions do the same things, I have added definitions for various NeXTSTEP functions. These will be changed to inline functions when I find the time to do that. * Removed GCC source and IN_GCC dependencies. Changed local includes to global includes. The Objective C runtime can now be compiled independently from GCC. GNU Objective C release notes for gcc 2.4 ***************************************** *Note:* This chapter contains the release notes for the original GCC Objective C runtime which comes with GCC 2.5.8. GNU Release notes ================= Since gcc 2.3.3 the Objective C as part of gcc has changed a lot. This document is to explain what has been done, and a little about how specific features differ from other implementations. The runtime has been completely rewritten. The earlier runtime had several severe bugs and was rather incomplete. The compiler has had several new features added as well. This is not documentation for Objective C, it is usable to someone who knows Objective C from somewhere else. Runtime API functions ===================== The runtime is moddeled after the NeXT Objective C runtime. That is, most functions have semanthics as it is known from the NeXT. The names, however, have changed. All runtime API functions have names of lowercase letters and and underscores as opposed to the `traditional' mixed case names. The runtime api functions are not documented as of now. Someone offered to write it, and did it, but we were not allowed to use it by his university (Very sad story). We have started writing the documentation over again. This will be announced appropriate places when it becomes avilable. Protocols ========= Protocols are now fully supported. The semanthics is exactly as on the NeXT. There is a flag to specify how protocols should be typechecked when adopted to classes. The normal typechecker requires that all methods in a given protocol must be implemented in the class that adopts it - it is not enough to inherit them. The flag `-Wno-protocol' causes it to allow inherited methods, while `-Wprotocols' is the default which requires them defined. +initialize =========== This method, if defined, is called before any other instance or class methods of that particular class. This method is not inherited, and is thus not called as initializer for a subclass that doesn't define it itself. Thus, each +initialize method is called exactly once (or never if no methods of that particular class is never called). Besides this, it is allowed to have several +initialize methods, one for each category. The order in which these (multiple methods) are called is not well defined. I am not completely certain what the semathics of this method is for other implementations, but this is how it works for GNU Objective C. Passivation/Activation/Typedstreams =================================== This is supported in the style of NeXT TypedStream's. Consult the headerfile Typedstreams.h for api functions. I (Kresten) have rewritten it in Objective C, but this implementation is not part of 2.4, it is available from the GNU Objective C prerelease archive. There is one semathic difference worth noting concerning objects stored with objc_write_object_reference (aka NXWriteObjectReference). When these are read back in, their object is not guaranteed to be available until the `-awake' method is called in the object that requests that object. To objc_read_object you must pass a pointer to an id, which is valid after exit from the function calling it (like e.g. an instance variable). In general, you should not use objects read in until the -awake method is called. Acknowledgements ================ The GNU Objective C team: Geoffrey Knauth (manager), Tom Wood (compiler) and Kresten Krab Thorup (runtime) would like to thank a some people for participating in the development of the present GNU Objective C. Paul Burchard and Andrew McCallum has been very helpful debugging the runtime. Eric Herring has been very helpful cleaning up after the documentation-copyright disaster and is now helping with the new documentation. Steve Naroff and Richard Stallman has been very helpful with implementation details in the compiler. Prerelease Archive ================== Intermediate releases, bugfixes and additional other information of the GNU Objective C will be available from iesd.auc.dk in the directory /pub/ObjC. Bug Reports =========== Please read the section `Submitting Bugreports' of the gcc manual before you submit any bugs. The future ********** The future could depend on *you*. I am constantly working at ObjectiveAmiga, but I do have other projects, too. Besides that there are so many parts of ObjectiveAmiga which need to be completed that I simply cannot do everything at once. If you want to help me with the development of ObjectiveAmiga, feel free to contact me. Of course I can't offer you anything for your work. I'm not getting anything either ;) Getting in touch **************** If you want to contact me, send EMail to s.zeiger@laren.rhein-main.de. Bibliography ************ [1] NeXT Computers, Inc.: NeXTSTEP Object-Oriented Programming and the Objective C Language Release 3 Addison-Wesley 1993 [2] NeXT Computers, Inc.: NeXTSTEP General Reference, Volume 1 Release 3 Addison-Wesley 1992 [3] Brad J. Cox, Andrew J. Novobilski: Object-Oriented Programming - An Evolutionary Approach Second Edition Addison-Wesley 1991