Miscellaneous fixes, especially to ObjC runtime description.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1143 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1996-03-13 02:44:00 +00:00
parent 401f21c5d9
commit b007314045

View file

@ -1,6 +1,6 @@
@chapter GNUstep Frequently Asked Questions with Answers
Last updated 3 March 1996.
Last updated 11 March 1996.
Maintained by Andrew McCallum <mccallum@@gnu.ai.mit.edu>, with
contributions by Pascal Forget <pascal@@wsc.com>, Scott Christley
<scottc@@net-community.com>, and Randy Chapman <chapman@@u.washington.edu>.
@ -29,27 +29,26 @@ The GNUstep project consists of the following sub-projects:
@itemize @bullet
@item GNU Compiler and Objective-C Runtime Library - though not part of
the GNUstep project per se, the GNU Compiler is used to compile
Objective-C code and the Library is a fundamental part of any GNUstep
application. Of particular interest to the GNUstep project is its
efficient thread-safe capability.
@item GNU Objective C Compiler and Objective C Runtime Library -
Although not actually a sub-project the GNUstep, GCC and the GNU
Objective C Runtime Library are integral to GNUstep, since they are used
to make every GNU Objective C program.
@item GNUstep Base Library - code for non-graphical objects, such as
@item GNUstep Base Library - Code for non-graphical objects, such as
strings, collections, archiving support and distributed objects
messaging. (Including functionality similar to OpenStep's
@samp{FoundationKit}.)
@item GNUstep GUI Library - code for graphical objects used in making a
@item GNUstep GUI Library - Code for graphical objects used in making a
Graphical User Interface (GUI). This includes buttons, sliders, text
fields, windows, menus, etc. (Including functionality similar to
OpenStep's @samp{AppKit}.)
@item GNUstep DisplayGhostScript Server - a server that draws PostScript
@item GNUstep DisplayGhostScript Server - A server that draws PostScript
graphics to the screen, and receives events from the keyboard and
mouse. It is based on GhostScript.
@item GNUstep Interface Modeller Application - an application for
@item GNUstep Interface Modeller Application - An application for
graphically assembling application interfaces.
@end itemize
@ -68,16 +67,14 @@ the FAQ maintainer.
The initial target platforms for GNUstep are Linux and other UN*X's.
There has been some OS/2 WARP work, but I have not seen any ongoing work
on this platform.
on this platform yet, (contact McCallum if you are interested).
@item What is the OpenStep standard?
OpenStep is an Application Programming Interface (API) for creating
applications using the Objective C language. It was published by NeXT
Computer Inc. in 1994. It is being used by Sun Microsystems as part of
their Common Desktop Environment (CDE), and it is being used by Ohio Carbon
Blank as part of their On-line Virtual Community Project.
Computer Inc. in 1994.
OpenStep consists of three parts: the @samp{FoundationKit}, a library of
non-graphical objects; the @samp{AppKit}, a library of objects usful in
@ -209,7 +206,7 @@ can be found below.
With free software, you should never, ever, believe promises about when
a project will be finished. ...However, that said: there are certain
GNUstep developers that are counting on having useful Base and GUI
libraries working by Summer 1996.
libraries working by the end of Summer 1996.
@item How can I help?
@ -224,50 +221,87 @@ Andrew McCallum <mccallum@@gnu.ai.mit.edu>.
More detailed inforation about each of the GNUstep sub-projects can be
found below.
@section GNU Compiler and Objective-C Runtime Library
@section GNU Objective C Compiler and Objective C Runtime Library
@enumerate
@item What is the Objective-C Runtime Library?
@item What is the Objective C Runtime Library?
The Objective-C Runtime Library is a library of C functions and data
structures required to execute an Objective-C program. There has been
much written about the special capabilities of Objective-C; we refer you
to these resources to learn more about the language:
The Objective C Runtime Library provides C functions and data structures
required to execute an Objective C program. An introduction to the
Objective C Language is provided at
@samp{http://www.next.com/Pubs/Documents/OPENSTEP/ObjectiveC/
objctoc.htm}. The Frequently Asked Questions list for
@samp{comp.lang.objective-c} can be found at @samp{??}.
NEXTSTEP Object-Oriented Programming And The Objective-C Language
Addison-Wesley Publishing Company
ISBN 0-201-63251-9
The GNU Objective C Runtime Library offers everything NeXT's runtime
does, including Categories, Protocols, @samp{+poseAs:}, thread-safety,
class initialization on demand, delayed loading of classes, and
initialization of static instances (such as @@""-style string objects).
It also has several improvements over NeXT's implementation:
@itemize @bullet
@item NeXT's runtime requires an extra function call (objc_msgSend) for
each message that is sent; (the function looks up the receiving
instance's implementation of the method). GNU's implementation is
faster because it does not use an extra function call. Instead, it
inlines a short piece of code that makes two pointer hops into a method
dispatch table; because the code is inlined, it does not incur the
overhead of a function call.
@item When running in thread-safe mode, NeXT's runtime must aquire a
global mutual exclusion lock every time a message is sent; this is
extremely slow. GNU's runtime, amazingly, sends messages just as fast
in thread-safe mode as it does in single-thread mode---the code path
does not contain even a single extra instruction! The GNU runtime only
needs locks when certainly structures are written, not read; the
structures are written relatively infrequently: only at class
initialization and when @samp{+poseAs:} is called.
@item GNU's runtime provides ``selector-types'' along with each
selector; NeXT's does not. A selector-type is a string that describes
the C variable types for the method's return and argument values. Among
other uses, selector-types is extrememly helpful for fast distributed
objects implementations, (see GNUstep Base Library Section, below).
@item Many of the GNU functions have different names than their
corresponding NeXT functions; the GNU names conform to the GNU coding
standards.
@item GNU's runtime library has a new class heirarchy manipulating
method called @samp{-transmuteClassTo:}. It can change the class of an
instance to a cousin class of the same instance-size.
@item NeXT's compiler, @samp{cc}, is based on an old version of
@samp{gcc}. GNU's compiler is, of course, the latest version of
@samp{gcc}, and therefore contains all the latest enhancements.
@end itemize
FSF's implementation utilizes a very efficient sparse array for storing
and looking up selectors when performing method calls, and recently has
been enhanced to provide thread safe operation that induces NO overhead
to method calls. It has full support for protocols and categories.
@item What is its current state of development?
As of this writing 2.7.2 is the most recent version of the GNU Compiler;
it can be obtained at any of the FSF's ftp archives. This version does
not contain the patches for thread safe operation; though a later release
of the compiler will, so you must apply the patch which is distributed
with the GNUstep Base Library and recompile the Objective-C Runtime Library.
GNU's Objective C Runtime library has been stable and useable since
1993. Enhancements continue to be made.
The thread safe patch defines a number of functions for maintaining mutual
exclusion objects and threads. The NSThread and NSLock type classes
in the GNUstep Base Library are based upon these underlying functions, but
you can call them directly if you are not using GNUstep. The implementation
is based upon a back-end program for the underlying operating system;
currently Microsoft Windows NT/95, SGI Unix, and Sun Unix have back-end
tested implementations. Volunteers are solicited for writing additional
back-ends, especially one for Linux which is sorely needed.
The package @samp{gcc-2.7.2} contains the source for the GNU Objective C
compiler and runtime library. It can be obtained from
@samp{ftp://prep.ai.mit.edu/pub/gnu}, or any other mirror of the GNU
archives. As far as I know, the GNU Objective C Runtime runs on all,
platforms on which GCC runs.
Additional detail about the implementation of thread safe operation can be
found in the source code and related documentation files. The Library
will still operate in a single, non-threaded, environment but any attempt
to create a thread will return an error.
GCC version 2.7.2 does not contain the thread-safe features, but the
next version of GCC will. A patch for thread-safe features is provided
with the latest developer snaphots of the GNUstep Base Library. There
are currently thread-safe backends for DEC OSF/1, Solaris, IRIX, and
WindowsNT. Volunteers are solicited for writing additional back-ends,
especially one for Linux.
@end enumerate
@c GNU Compiler and Objective-C Runtime Library
@c GNU Compiler and Objective C Runtime Library
@section GNUstep Base Library
@ -363,12 +397,12 @@ variety of enumeration methods based on invocations.
@item OpenStep's archiving mechanism provides only one choice of backend
format. By backend format, I mean a format for writing C types, such as
ints, floats and C strings. The GNUstep archiving mechanism has a clear
separation between frontend and backend. Different backends backend's
are provided. One writes in human-readable and human-editable ASCII
separation between frontend and backend. Different backends are
provided. One backend writes in human-readable and human-editable ASCII
text, (including programmer-provided text name labels for each of the
items.) Another writes in a compact, stream machine-independent bits.
A third writes in an even more compact stream of machine-dependent bits;
this is useful for a distributed objects connection on machines of the
this is useful for distributed objects connections on machines of the
same architecture.
I'm not sure how OpenStep's archiving system implements forward
@ -434,11 +468,11 @@ Collection Root all the collection classes (abstract)
Queue First in, first out
Stack First in, last out
GapArray Efficient handle middle insert and delete
LinkedList More efficient than arrays for many ops
LinkedList More efficient than arrays for some ops
Strings (as in Smalltalk, part of the collection class heirarchy):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ConstantString Root of string classes, not changable
ConstantString Root of string classes, chars not changable
String contents can be changed
*CString Strings based on 1-byte characters
@ -529,6 +563,7 @@ It provides functionality that aims to implement the @samp{AppKit}
portion of the OpenStep standard. However the implementation has
been written to take advantage of GNUstep enhancements wherever possible.
@item Explain the organization of the front- and back-ends.
The GNUstep GUI Library is divided into a front- and back-end. The
@ -558,13 +593,14 @@ A number of classes in the front-end are complete or almost complete;
these include: NSActionCell, NSButtonCell, NSButton, NSCell, NSControl,
NSEvent, NSFont, NSResponder, and NSSlider.
These classes are complete enough to use but still require some major
additions before being considered almost complete: NSApplication, NSBox,
Other classes are complete enough to use, but still require some major
additions before being considered almost complete: NSApplication, NSBox,
NSColor, NSFontManager, NSMenu, NSMenuCell, NSPopUpButton, NSSliderCell,
NSText, NSTextField, NSTextFieldCell, NSView, and NSWindow.
All remaining classes have stub implementations.
@item What is the current state of development of the X/DPS back-end?
@ -602,28 +638,31 @@ able to find it in @samp{ftp://alpha.gnu.ai.mit.edu/gnu}.
@item What is the Interface Modeller?
Interface Modeller in its simplest form is an application for visually
Interface Modeller, in its simplest form, is an application for visually
constructing and prototyping graphical user interfaces. At a more
abstract level, it is a tool for connecting instances of Objective-C
abstract level, it is a tool for connecting instances of Objective C
classes to create a graph of objects; this graph is a model of an
executable program that Interface Modeller can save to a file to be
loaded and executed later outside of Interface Modeller.
@item What is its current state of development?
It is in the specification stage; no code has been written yet. You
may read the current specifications at the GNUstep WWW pages.
It is in the specification stage; no code has been written yet. The
current specifications are available through the GNUstep WWW pages.
@end enumerate
@c GNUstep IM
@format
@ignore
[Notes to FAQ contributors: Be succinct. Stick to the facts. Emphasize
technical features that are already implemented; avoid writing about
vague features without concrete ideas about their implementation; (the
IM section, for example, may be short?). Your audience is future and
present code contributors to GNUstep, not managers or publicity people.]
vague features without concrete ideas about their implementation. Your
audience is future and present code contributors to GNUstep, not
managers or publicity people.]
@end ignore
@format
All trademarks mentioned on in this FAQ belong to their respectful