Rhapsody FAQ
Volume Number: 13
Issue Number: 7
Column Tag: Rhapsody
Rhapsody FAQ's
by Michael Rutman, independent consultant
You've heard the rumors, but how much is true?
But a Friend Told Me...
With today's ever changing technology, finding out information about future
technologies can be challenging, especially when it is difficult to get hands-on
experience with that technology. Rhapsody is no exception. Even though Rhapsody is
based on OPENSTEP, which has been out for almost a decade, most developers have not
had a chance to play with it themselves.
Most developers rely on word of mouth and trade magazines for obtaining their
information. While trade magazines are great for getting facts, word of mouth is what
most people rely on. Unfortunately, word of mouth isn't always as reliable as one
would hope.
After seeing these technologies in action at WWDC and talking with Apple engineers and
Evangelists, many of the rumors are clearly wrong. In this article, I hope to cover
popular rumors and debunk them one by one.
Display Postscript is slow
OPENSTEP uses the Display Postscript model for all drawing. This allows true
WYSIWIG and easy printing code. OK, sounds good, but aren't there downsides? Isn't my
Postscript LaserWriter very slow?
Yes, Postscript used to be very slow, but was so powerful it was worth the wait.
Waiting for a high quality printout is not as painful as waiting for the screen to update.
When NeXT decided to use PostScript for their screen display, Adobe and NeXT realized
they would need to improve PostScript's speed. The optimizations they implemented
included using integer font metrics for screen fonts, lazy depth promotions,
compression of the backing store of a window, better algorithms for color conversion
and dithering, file mapping, and many more.
So, did this work? In a nutshell, yes, it worked very well. As Apple is proud of saying,
Display Postscript is 266 times as fast as the LaserWriter NT. So, if you believe
Apple statistics, and if your LaserWriter NT can do 16 pages a minute, then you should
be able to do 71 frames a second, which is as fast as the monitor can display anyway. It
is nice what you can do with statistics, but how does it feel?
To prove that Display PostScript is quite nice, Apple put up two windows running
different QuickTime movies with a lot of motion. During their live demo, they dragged
the windows around the screen overlapping the two windows; the audience saw perfect
clipping, no stutter, no delays. The QuickTime movies continued playing as they were
dragged. Most Macintosh users are used to dragging an outline of a window instead of a
window. MacOS drags outlines for speed. Under Rhapsody, Display Postscript is fast
enough to continue displaying QuickTime movies while being dragged.
Seeing is believing, and I saw Display Postscript displaying a lot of nice graphics very
quickly.
I need to know postscript to program under Rhapsody
Rhapsody draws in PostScript, and knowing PostScript would be useful. However,
there is a difference between it being a good idea to know PostScript and having to know
PostScript.
The vast majority of PostScript is hidden from the developer. OPENSTEP's framework,
called the AppKit, handles all the setup PostScript needs for drawing or printing
views. A developer that wants to modify the default behavior would have to know
PostScript, but the vast majority of developers will never need to do this.
The common PostScript commands - the ones for drawing lines, circles, rects, setting
colors, and so on - are wrapped by C functions. Drawing a rectange is done with
NXFillRect( const NXRect *). A developer need only pass a rectangle to this routine and
the rectangle is drawn. Even though the low level drawing is done in PostScript, the
developer need only know that there is a routine that draws a rectange. For finer
control, PSsetcolor(NXColor *) sets the drawing color, PSmoveto, PSlineto, and
PSStroke can do individual lines.
Almost all entities displayed, such as boxes, buttons, popups, and windows are objects
that hide all of the PostScript needed for drawing. As long as standard controls are
used, no PostScript need be created. Of course, if a complex PostScript entity has to be
generated, the code can be written into a PSwrap and downloaded to the PostScript
server. However, to do this one would have to learn PostScript. My experience is that
pswraps are useful, but rarely necessary.
My mom isn't going to want to learn unix
Rhapsody is based on unix, but what does that mean? Many people believe that unix is a
command line interface into a file system where you have to type grep a lot. Nobody
wants to dump this on an unsuspecting user, and NeXT has worked on hiding unix for
years. Now that NeXT and Apple are combined, there is a strong push to hide unix even
farther.
How to hide unix has always been tricky, and early versions of NEXTSTEP didn't do a
very good job of it. Because unix kept peeking up its ugly head in the early days, there
is a lot of word of mouth bashing of Rhapsody, and that is unfortunate. Over the last 8
years, NeXT has done a good job of putting the unix layer well under a pleasant user
experience. Everything your mom can do on the Mac can be done under Rhapsody in the
same way.
OPENSTEP, however, is for both your mom and you. For power users, OPENSTEP still
has a terminal window that accesses the unix layer directly, and those developers who
want to can type grep to their hearts content. If they don't want unix, there are other
ways to do what they want to accomplish. The unix command line is there only for the
people that want it. It is important to remember the difference between having a tool