PROGRAMMING PARADIGMS

Apple Talks the Talk and Walks the Dog at WWDC

Michael Swaine

This year's "Quadruple Nickel Award for Fully Grasping the Paradigm" goes to the agent who brought together Jerry Pournelle and Newt Gingrich to collaborate on a science-fiction novel, a concept so trippy that if it weren't true it would be a science-fiction novel. Runners-up: The advertising agency that decided that Rush Limbaugh's TV viewers are just the sort of people who would buy spearmint-flavored chewing tobacco; and G. Gordon Liddy, of Watergate fame, who has been offering advice of late on dealing with burglary, a paradigm regarding which his expertise is a thing of legend.

Meanwhile, out here on the paradigms beat, I'm mostly beating on Apple. This month's column is largely Macintosh (I may pull a little Newton out of my sleeve before I'm through). It touches on scripting, with updates on the various Mac scripting tools I've mentioned here from time to time--HyperCard, Frontier, SuperCard, FaceSpan, AppleScript--with a nod to how or whether these things connect with CGI scripting for Web services. And there's a heavy Internet emphasis. I'll even point you to a new organization for Web-page developers, in case you've decided to make your fortune writing <blink>HTML</blink>.

But first, these bulletins from the rubber-chicken circuit.

Talking Dog

They were talking dog, Cyberdog to be precise, at this year's Worldwide Developer's Conference (WWDC) in San Jose. Cyberdog is the codename of Apple's Internet strategy.

One strategy for Internet access, Apple execs pointed out as they paraded the pup before the press in a Cyberdog sneak at the conference, is the integrated app, exemplified by TCP Connect. Another strategy is the suite of Internet tools, exemplified by Internet-in-a-Box. Cyberdog, scheduled to be released to developers by the time you read this and to the great unwashed early in '96, is a third approach: a collection of Internet-supporting OpenDoc parts.

It's an approach designed to strike a balance between Apple's own need to provide a complete Internet-user solution and third-party developers' need to sell Internet products without having to compete head-on with Apple. Although Cyberdog will provide a "complete" collection of basic parts for Internet access, third-party developers will be able to sell better individual parts or collections. The OpenDoc approach will also make it possible to embed these communication facilities in applications, and will support a scheme in which any user can create an interface to the Internet.

Initially, Apple will supply a generic container, plus some obvious parts, like a World Wide Web part, a Gopher part, a text part, a picture part, and context parts (a personal notebook and a log). These container parts will contain live links, and dragging something from the log to the desktop will create a double-clickable stand-alone link to the site.

Cyberdog is the most encouraging sign I've seen from Apple in a long time, because of what it could mean for OpenDoc. For Apple, the move to OpenDoc is as big as the move from the 680x0 to the PowerPC chip, but it's more than that, because it's not just Apple's move. The shift from monolithic apps to part-based software enabled by OpenDoc and OLE will be a true revolution in software development, in software marketing, and even in the way people use software. Whether it will all play out the way Apple hopes is an open question. I hope it does, not for Apple's sake, but for the users. Cyberdog, a compelling deployment of OpenDoc into the hottest market of the day, could be the wedge Apple needs to make OpenDoc as successful as Apple needs it to be, as quickly as Apple needs it to happen.

Bobbing for Apple

Apple's response to Microsoft's Bob user interface is the many faces of Copland.

Apple gave out mucho info about its next OS release at the WWDC, despite the fact that Copland won't actually be released till mid-1996. Possibly the most dramatic aspect of Copland is the customizability of its user interface. Although the Mac UI has always been customizable (which explains the drop in worker productivity that has accompanied the widespread computerization of the American workplace), Copland takes it further, largely abandoning the idea of a single Macintosh look and feel. Demos showed a child's UI with single-click buttons rather than icons and sticky menus and colorful window treatments, a more conventional Mac UI, and something that looked like a video game or an application designed by Kai Krause.

Other new interface features: Views, live windows whose contents are based on user-specified criteria and which are automatically updated; Drawers, windows that close not to icons but to tabs across the bottom of the screen; and spring-loaded windows, an elegant feature better seen than described.

The real story in Copland is that this is the microkernel-based, nearly all-PowerPC-native version of the OS. The file system, I/O, and net services are all memory protected and preemptively multitasked. Disk, network, and Finder actions can all happen at the same time. There's a new native file system with a concurrent, reentrant design.

Apple was uncharacteristically subdued at the conference, focusing more on substance and less on hype than in past years. They even admitted openly that QuickDraw GX needs improvement. PowerTalk and GX (presumably after improvements) will be in the default installation of Copland (and will use less RAM), so your app can assume their presence.

As mentioned last month, Apple Guide will transmogrify into Apple Assistant, a tool for creating time- or event-based agents.

CGI Rules, AppleScript Tools

Web pages don't have to be passive; clicking on a link on some pages fires up an application on the host machine that can do almost anything. This ability to drive an app over the World Wide Web opens up the possibility of all kinds of tricks.

Common Gateway Interface (CGI) scripts are the preferred method for driving apps from a Web page for anyone using WebSTAR (formerly MacHTTP). Using CGI is a three-step process:

  1. Append the information that needs to be sent to the application to the URL in your HTML document. A question mark (?) flags the end of the file reference and the beginning of the data (for example, http://www.college.edu/thePathToTheApp$text_to_find).
  2. Create an Apple event message containing the URL and the data.
  3. Send this Apple event to the application indicated by the URL.
In other words, CGI is the key to Web pages that do interesting things, and AppleScript is the key to CGI.

The best place to learn about CGI scripting is http://www.uwtc.washington.edu/Computing/WWW/Lessons/START_HERE.html.

Frontier is Free, SuperCard isn't

Userland's Frontier was the first system-level scripting system for the Mac, before AppleScript. As AppleScript lurched toward release, Userland kept Frontier consistent with it, in the process throwing away some tools and approaches that were arguably better that what Apple settled for. (I know the point is arguable because Userland founder Dave Winer argues just that.) This spring, Userland bent to the inevitable and gave up trying to make money selling a product that competes directly with technology that Apple's giving away. Frontier is now free and can be downloaded from http://www.hotwired.com/Staff/userland/aretha/project1writingcgiscri_227.html.

Userland is not down for the count, though, and Dave expects to make money from derived products, especially Internet-related products. For example, Userland had a lot of experience in developing Frontier solutions to manage workflow for editorial organizations: picking up copy from editorial, flowing it through QuarkXPress, laying out the publication, and passing the result off to the designers. In a product called "AutoWeb," Userland took what they had learned about automating print publishing and applied it to the development, deployment, and maintenance of web-page structures.

The aforementioned URL is also the place to learn about AutoWeb and to find out how to create CGI scripts using Frontier. Since Frontier can edit and run AppleScript scripts but is a richer language, you can use Frontier to build on existing AppleScript CGI scripts.

SuperCard, a HyperCard-like program created by Silicon Graphics shortly after the release of HyperCard and much loved by multimedia developers, was bought and later set free by Aldus. Last year it was reacquired by Allegiant, a company formed by Silicon Graphics alumni. This year at WWDC, Allegiant announced NetTalk, a tool that lets Mac scripters build custom interfaces to the Internet.

NetTalk is an intermediary that sits between SuperCard (or HyperCard or Frontier or Prograph or FaceSpan) and the Internet. Among other capabilities, it includes direct back end CGI support for WebSTAR. FaceSpan? That's the AppleScript user-interface builder I've mentioned here before. Since it's OSA compliant, it'll work with scripts written using Frontier, too, or with SuperCard, HyperCard, and so forth.

HyperCard is Hyped

HyperCard 2.3 was announced at WWDC with a subdued fanfare volume that befitted its right-of-the-decimal-point newsworthiness. It's a true 0.1 increment revision, the big improvement being that it's now PowerPC native, something that the more naive among us sort of expected to happen about the time the PowerPC machines were released.

Apple also threw another bone to the dogs yapping for color, but HyperCard remains, still in 1995, in its heart of hearts, a black-and-white application. The strategy seems to be to wait out the complaints until wired-in (as opposed to taped-on) color ceases to be an issue. Exactly how it will cease to be an issue I couldn't say, since I don't know where HyperCard is really headed. I don't mean to suggest that anyone, least of all Apple, does. But Apple hints at some scenarios.

Does HyperCard become an OpenDoc container, a Swiss Army knife with a Gillette philosophy? ("Give away the razor and sell them the blades." Or was that Gillette?) Then the lack of real color becomes a business opportunity.

Does HyperCard become a front end for AppleScript? (More so than it already is, that is.) Does Apple send FaceSpan off to Frontierland? Then color painting becomes a needless frivolity, and the color already bundled in may be adequate.

Does HyperCard figure in Apple's Internet strategy? Does it become an HTML editor? (Nobody's suggested this, but read on.) Or does it become a highly scriptable database back end for Web pages managed with Apple's Web servers? (It's bundled with the servers now, as one of the database options.) Either way, it can get along without full color support.

Real color isn't an issue in any of these scenarios for an imagined future HyperCard. No, it's only the real HyperCard, the in-house programmer's secret weapon, the quick-and-dirty prototyping tool, the unappreciated multimedia development environment, the educator's salvation, that will suffer from this neglect. But then, they're used to it by now.

HTML Gets Emotional

Yes, I recently poked fun at the concept of schooling people in how to create vanity Home pages, but Web-page creation is a legitimate job and a really hot area. If you're interested in watching or becoming a part of the creation of a new job classification, check out the HTML Authors Guild mailing list. Just send the message "subscribe html-authors-guild <your name>:" to Majordomo@lists.stanford.edu. Another list you should be checking out if you're using WebSTAR is the MacHTTP-talk list (send "subscribe machttp-talk <your name>" to Majordomo@academ.com). Warning I wish somebody had given me: Subscribing to both of these lists can fill your mailbox rapidly.

I keep reading those "How did Joe create this really nifty Web page?" pages, and they always say the same thing: Joe has looked at various HTML editors, but they all lacked some feature he wanted, so he just wrote the page with his word processor.

I'm developing Web pages, too, and while there are many editors, even many approaches to editors (filters for BBEdit, ClarisWorks, Adobe PageMaker, QuarkXPress, and Microsoft Word; WebWorks from Quadralay, a tweenware app for FrameMaker; stand-alone HTML editors like SoftQuad's HoTMeTaL Pro, Rick Giles's Prograph-based HTML Editor, Robert Best's HTML Web Weaver, and Eric Lease Morgan's HyperCard-based Simple HTML Editor; and more-or-less WYSIWYG editors like Open Door Networks's HyperCard-based WebDoor and Navisoft's NaviPress), I discover, not to my surprise, that none of them work the way I want. So I wrote my own.

I wanted to be able to more or less drop in a new vocabulary when HTML 3.0 or VRML or something else got formalized; I wanted a facility for stockpiling boilerplate text, boilerplate HTML, and all my favorite URLs, and dropping them into my documents easily; I wanted references to all HTML documents I created to be immediately available for dropping into other HTML documents in proper HTML local-link format; I wanted easy customization for features I didn't think of, like automatic documentation of the files referenced in a document and automatic date/time stamping of HTML documents; and I wanted hot links.

I used--you guessed it--HyperCard (Version 2.2, in fact). The color tools are a pain, but they're adequate for colorizing buttons, which was all I wanted. The result meets my needs, but I don't know whether anybody else would use it. Drop me a note if you're a Mac type and are curious; I'll tell you where to find it.

:-)If you have zero interest in HTML, you may be depressed to learn that some people are now using it to create new emoticons in e-mail and online chat.:-)

MessagePad Messages Macs

When Apple introduced the Newton MessagePad PDA, it only had a few boneheaded faults. It cost too much, it didn't have a built-in cellular modem, and the handwriting recognition was inadequate. Apple hasn't fixed any of those things, but forces outside the company have helped some. You can now buy an early model MessagePad for an acceptable $149, although the new ones remain around $600. There are good PCMCIA cellular modems. Palm Computing has more or less fixed the handwriting problem.

ScriptLink, from Momentum (Greenwood, Australia), doesn't solve a Newton problem; it adds a capability you might not have expected in the original device. Or maybe it solves a problem created by the fact that the Newton devices use an entirely new operating system. ScriptLink brings AppleScript to Newton.

ScriptLink lets Newton apps control Mac apps. It consists of two components: the ScriptLink Macintosh Server, an application that needs to run in the background on a Mac, and ScriptLink Newton Client, a Newton package that must be installed on the Newton device. It works like this: You develop a Newton application that contains embedded AppleScript. When the Newton app accesses the AppleScript, the app triggers ScriptLink Newton Client to send the AppleScript to ScriptLink Macintosh Server somewhere out on the net, and ScriptLink Macintosh Server dispatches the AppleScript to the target Mac application.

It's a cute little system, and it works. What can you do with it? Use the Newton to query databases, upload Newton-captured data automatically to a Mac database, or drive AppleScript-savvy Mac apps. Not difficult to master, ScriptLink offers the Newton developer five new calls: slConnect, slDisconnect, slSendScript, slConnectionStatus, and slTransOutstanding, plus a few callbacks. One of the supplied examples shows how to create an entire word-processing document on the Mac from the Newton. I like it.

Too bad that both MessagePad sales and Apple's share of the market it opened are declining.


Copyright © 1995, Dr. Dobb's Journal