NeXTSTEP Technical Review

Twenty years ago, Steve Jobs founded Apple Computer. Twelve years ago, he was thrown out. Now he's back, bringing with him his own unique "reality distortion field" and a mixed bag of software that we are told is going to turn Apple around, one way or another.

Apple have bought NeXT Software Inc, lock stock and barrel, for a price that was allegedly as much as Jean Louis Gassee was asking for Be. The first fruit of this union is a detailed plan for releasing the new operating system for the Macintosh, to replace the cancelled Copland project, codenamed "Rhapsody". Rhapsody will be based initially on NeXTSTEP, the operating system acquired with NeXT, and with a development team consisting mainly of engineers from NeXT, headed by Avadis Tevanian, formerly head of Development at NeXT.

Rhapsody will run on all current Power PC Macintoshes. The initial release for developers will use the OpenStep API (Application Programming Interface), which is part of the NeXTSTEP operating system, and the user interface also from NeXTSTEP, with minor adaptations taken from the Macintosh System 7 interface. The full release of Rhapsody will have further adaptations of the user interface, will include additional toolkits from Macintosh, and will run most System 7 applications.

To dispose of the big three questions; NeXTSTEP multitasks, supports multiple processors, and has protected memory.

The Prodigal Returns

In 1985 Steve Jobs left Apple, and started NeXT Computer Inc. He took with him a small team from the Macintosh group, and together they set about designing Steve's next computer. At Apple Steve visited Xerox PARC, and had seen two great ideas: the graphical user interface and object oriented development. At Apple he had used one of those ideas with Lisa and Macintosh; this time he would use the second. Just like Sun earlier, they started with a a free hardware design, and took the best of what they saw around them. An already written operating system: Unix. A simple new object oriented language called Objective C; at the time C++ wasn't ready. They considered the X Window system and threw it out, and instead chose to develop a new system based on Postscript, as Sun had already done.

In 1988 the results of their labours was released to an amazed public: the NeXT cube. A perfect one foot cube cast in black painted magnesium alloy, the cube was a monochrome system with no hard disk and no floppy drive for $10,000, intended to sell only to education. The only storage medium available initially was a 256Mb optical drive, significantly slower than then current hard disks. Over the next few years NeXT gradually introduced hard disks, floppy drives and colour, and moved from education to publishing to corporate mission critical application development in bewildering succession, but it was no great surprise to the world when in February 1993 they ceased hardware production. Many people thought that they had gone out of business altogether.

Four months later, the first releases of NeXTSTEP for Intel processors started to ship. The complete software environment from NeXT hardware was available to run on a few tightly specified combinations of Wintel hardware. NeXT had previously developed a version of their operating system for IBM, running on 386 based PS/2 computers, and then on top of AIX on the RS/6000, but it was never released. Building on this experience, in rapid succession they released ports of NeXTSTEP for Hewlett-Packard PA-RISC workstations, and Sun SPARC workstations. Other ports had been considered, to Digital alpha workstations and to dual processor Motorola 88110 and Power PC 601 custom designs, but these had never made it to production.

By 1995 NeXT were working on OpenStep, a port of their development environment to run on top of Windows NT and Windows 95, losing focus from their operating system products. In rapid succession they lost interest completely in operating system development, and released yet another development environment, this time for Web servers.

Architecture

NeXTSTEP consists of a number of layers, as shown in the diagram. Each of these layers is relatively independent, and has been replaced with other components at one time or another in NeXT's history.

The kernel is Mach, originally from Carnegie-Mellon University, where Avadis Tevanian was a graduate student working on the project. The current incarnation of Mach at CMU is now a microkernel, but NeXT used Mach 2.0 and 2.5 code, which was a conventional kernel design. A kernel is the minimal heart of an operating system; not enough for a user to do anything (even less than MS-DOS), but enough for programmers to develop programs that should be independent of the hardware running the operating system. The Mach kernel can take on various personalities to support different operating systems.

Above Mach, NeXT have slotted in a relatively early version of BSD Unix 4.3. This provides most of the operating system services that a user would recognise, including file systems, network support and the ability to run programs. NeXT had plans on the shelf to update to a newer version of Mach, which would in turn enable them to support a newer released of BSD Unix (4.4 Lite), with far superior networking code.

NeXT worked with Adobe to develop a version of Postscript, called Display Postscript, that was optimised to drive both printers and displays. Sun had done something very similar before, but working independently of Adobe. Display Postscript has extensions to enable it to create windows on a display and access documents. All access to the display in NeXTSTEP is done using Postscript (with one minor exception I'll get to later), and printing is supported within the operating system from the display using the same Postscript. Much of the Postscript is contained within the programmer toolkits, but most applications will contain a few sections of Postscript code for particularly complex custom drawing.

A lot of people know how to write Postscript, which is a big advantage. Exactly the same code is used to produce a screen display as to produce a printout; the only different is necessary adaptation to the different resolution of the printer and the display. This unified imaging model is a massive advantage for anyone concerned with print applications.

"More Mac than the Mac"?

The NeXTSTEP user interface was designed with the assumption that a user will have a mouse, keyboard and a megapixel display (one with approximately 1,000 x 1,000 pixels or better), and will be multitasking between several programs at once.

high-res

Menus appear in the top left corner by default, although other options are possible, including off the screen to be called up by a second mouse button (if you have one). Any submenu can be torn off and placed anywhere on the screen. Keystroke equivalents are available, and can be reprogrammed, including adding key equivalents for menu items that don't already have them.

A vertical bar down the right hand side of the screen called the Dock contains a variable number of 48x48 applications icons; if you launch an app that isn't already in the Dock, its icon will be stacked across the bottom of the screen. Icons in the dock show an ellipsis (three small dots) if they aren't currently running; this is in accord with the concept that you shouldn't have to care if an application is running or not. Because memory swapping to disk is reasonably efficient, most people don't bother to quit running applications, and just choose a menu option to hide application windows instead.

Most applications have one or a number of windows open at once. Windows can be moved by their title bar, miniaturised to an icon, closed, or resized by the use of standard user interface elements. Some windows will have scrollable text or image view in them. The scroll bar is on the left, and works proportionately. The scroller is resized according to the relative proportion of the total document displayed in the view, and clicking in the "elevator shaft" will reposition the view proportionately in the document. You can scroll a page at a time by Alt-clicking on the up or down scroll buttons. The document dynamically redisplays as you move the scroller.

Interface elements are mainly activated by the mouse; clicking, double and triple clicking and dragging all work as you might expect. For rarely used options clicking can be in combination with one of the keyboard modifier keys (Command, Shift, Alt and Ctrl). This is used in the File Viewer to select between copying, moving or linking (creating an alias) when dragging a document icon.

The File Viewer is a rough equivalent to the Finder. Multiple windows can be opened onto different parts of the file system. Each window consists of a shelf to place frequently used documents, a view of the path to the current document as a series of document icons, and a browser. The browser can display contents of a folder as icons, document names, or a listing view giving full details of document properties.

Unusually, the user interface includes a number of commonly used panels that are shared between applications. These include special panels for Open and Save, Printing and Faxing that are incorporated into any application with a use for the function. The Font selection panel is particularly flexible, allowing the selection of fonts of any point size, and previewing the appearance of a font. The Color panel is also noteworthy, as the user can build up a swatch of popular colours with a variety of colour models, including RGB, CMYK and Pantone, and the swatches are available to all applications.

Most applications use Inspector panels to view or modify the attributes of data. Inspector panels will change their contents according to the data selected in the main window of an application; this contains the multiple views that may sometimes be required into a single compact window.

Power User Features

With NeXTSTEP, you can configure your system to support multiple users, each with their own protected file area, and with their own customised desktop. On a network, your personal desktop can be used from any station on the network.

NeXTSTEP applications tend to be smaller and more compact that Windows or Macintosh applications. The reason for this is that applications interoperate well. You can run an unlimited number of applications at the same time, with their windows simultaneously visible. All applications support cut & paste through the pasteboard of text and images. Data that is pasted into another application can be connected to the original document by a mechanism called Object Linking, which will be continuously updated as the original document changes.

All applications include a special submenu called "Services". Applications can be service providers and include their own submenu under Services. Any selected data in one application can be passed to a service provider through this menu. One common use is to look up definitions of words in Webster. This mechanism also provides support for transparent conversion of new image types into NeXT's standard image formats, EPS and TIFF. There are several applications that provide scripting capabilities through Services, including one that ships with the system, Terminal.

On a network, you can run an application on one system with the displays shown on the screen of another system. This is similar to the X Window system, although it only works between NeXTSTEP systems.

The Case Against NeXTSTEP

The UI isn't Mac: the Macintosh user interface is well proven, and Macintosh users are notoriously loyal to their user interface. NeXTSTEP may have a well thought out user interface, but it isn't Mac, and there will be considerable resistance to change.

Apple rejected Display PostScript for poor performance: what was true ten years ago may not be true today. NeXT devotees gleefully demonstrate opaque window dragging, and will choose a 25MHz 68040 (the equivalent of a Quadra 700) to demonstrate on. NeXT also have an internal kit called Interceptor Kit, which allows a privileged application to punch a hole through the Postscript windowserver directly to the display card. This could be an option for implementing QuickDraw GX.

It's Unix!: to many people Unix means horrifying user interface design in the form of X Window, and a reliance on command line interfaces to get anywhere at all. NeXT seem to have patched over most of these holes, but there are a number of areas where the command line comes up and hits you in the face. Configuring a PPP connection to an Internet Service Provider is one of those.

Why should we replace a six year old OS (System 7) with a nine year old one?: multitasking and protected memory is the quick answer. The underpinnings of NeXTSTEP (Unix) go back to 1970, so it is a 27 year old OS if you want to be accurate.

NeXT were a marketing failure: sometimes they seemed to be doomed prophets, as in the case of the early adoption of the optical drive, rejecting the X Window system and C++, or in adopting object oriented development. Certainly their track record in press and developer relations is a legend in the industry.

What Does it Take to Run?

Current versions of NeXTSTEP run on anything from a 25MHz 68040 to a 200MHz Pentium Pro. Performance is reasonable on any Pentium, and on 486 66MHz and better. User configurations really need about 32Mb RAM, and 200Mb disk space. A developer can run with the same amount of RAM and 400Mb disk. A 17" colour monitor is ideal; any smaller looks cramped.

The Network is the Computer

NeXTSTEP can read and write floppies, optical and hard disks in several formats: NeXTSTEP, MS-DOS and Macintosh. This file support extends to disks mounted across the network. Third party products (respectively SoftPC and Executor) are available to run WIndows 3.1 and Mac applications.

NeXTSTEP networks use TCP/IP and NFS over Ethernet; they coexist well with Unix systems, and can attach directly to the Internet. All NeXTSTEP systems are automatically servers as well as clients. NeXT also supply software to support Novell Netware networks, although as clients only, and for WIndows 95 and NT networks, this time as servers only. At one time they included an AppleTalk module, which is now available commercially from a third party developer.

NeXTSTEP networks keep configuration information in a distributed database called netinfo, somewhat akin to the Windows Registry. This can be fully controlled from GUI applications specially provided for the purpose.

Developing a Case for NeXTSTEP

In recent years the market that NeXT have attempted to sell NeXTSTEP into was the large company, custom development role; which they referred to as "Mission Critical Custom Apps", or MCCA. The development environment is ideally suited to the rapid development of finished seeming prototype applications by professional developers, and is worth a close look.

The OpenStep API is fully object oriented, using the Objective C language. Objective C takes a few minutes (literally) for a C programmer to learn, and is much closer to the revered Smalltalk language than to C++. All of the graphical part of NeXTSTEP is developed using Objective C and the OpenStep API; as a result, applications developed by programmers share much of the same objects as NeXT applications, and are fully interoperable with them with very little work.

The development environment includes visual development tools, and is based around two closely coupled applications: Project Builder and Interface Builder. Project Builder controls all the resources in a project, include code, images, sounds and help files. It is also responsible for building and debugging applications. Interface Builder lets you compose user interfaces, but it also includes a limited class browser that can be used to build your own custom classes, and to control message passing between objects in your application. This is done by creating a special object archive document, which reduces the amount of extra source code a developer has to write, and allows some applications to be run and tested directly from Interface Builder, without have to be compiled.

NeXT sell an add-on product to NeXTSTEP called Enterprise Objects. This is a very sophisticated set of tools to give an object oriented interface into modern relational databases.

You've Got To Have Friends

The killer app for NeXTSTEP is development: so there is no one killer app, rather the ability to make any app you want faster and better than on any other platform.

NeXTSTEP applications are smaller and more compact than Windows or Mac apps, because they can intercommunicate more easily. As a result, despite the very small number of NeXTSTEP users (estimated to be around 30,000 worldwide), there is a healthy and thriving community of developers, with a full range of productivity apps and developer tools. There is also enough shareware to fill not one but several CDs, a lot of it with source code for examples of NeXTSTEP development.

If you want a word processor, spreadsheet, presentation package, project planner, charting tool, drawing package, image editor, custom report generator or diary and address book, they are all currently available and supported for NeXTSTEP. Four companies in the UK provide applications for NeXTSTEP, including a word processor (CedarWord), the biggest selling spreadsheet (Mesa), the industry standard 2D animation package (Animo), and SoftPC, the WIndows 3.1 emulator.

Crossing the Bar

Over the next eighteen months of the release schedule for Rhapsody, Apple will be putting in a lot of work to make NeXTSTEP more digestible to Mac users, including modifying the user interface and adding the ability to run System 7 applications.

However, many users will be considering making the switch at an early point to gain familiarity with the new OS, which will initially look like NeXTSTEP, and only run NeXTSTEP applications. The user interface will not be a problem for most Mac users, being designed to follow most of the same priorities as Mac, but with more modern hardware assumptions. For developers, as was planned for Copland, they will need to learn a completely new set of languages and toolkits, unless they want to wait for the MetroWerks ports of CodeWarrior.

NeXTSTEP is currently available for original NeXT hardware, Sun SPARC 5 and 10 systems, and for Intel PCs. For anyone considering buying a copy for an early peek, one word of warning: the current pricing is L530 for a User system, plus L3,000 for a Developer system, and you need both packages to develop. The good news is for students, who only need to pay L220 for a full User and Developer system. Apple should clean up this pricing and release at a reasonable level soon, if they have any sense.

For the last word I'll hand over to John Carmack, Technical Director of ID Software, who used NeXTSTEP to develop Doom and parts of Quake (that's right!): "We developed lots of products under dos (mostly borland c++), and never want to again. We went through five major iterations of our tools under DOS, and they are all junk below our first iteration of NS tools. You can't really just point at specific things and claim superiority. It is the complete package that has the appeal. NS is the best tool I have found for MY development work."

Paul Lynch
paul@plsys.co.uk