Channels ▼
RSS

Cheapo Bizarre Languages


DEC95: PROGRAMMING PARADIGMS

There are way too many Mikes in this world. There are even too many Mikes writing about the computer and electronics industries. I don't like to complain, but Jeez.

And in almost every case, I note that I was using the name first.

Mike Malone is known for his eponymous Public Television interview program ("Malone," I'm happy to say, not "Mike"), his book The Big Score (a history of Silicon Valley), and his pioneering investigative work on high-tech stories like the black market in chips and espionage in the electronics industry. His latest book, The Microprocessor: A Biography, dropped over the transom here at Stately Swaine Manor recently, and I couldn't put it down.

Not, at least, until I had enough material for the first third of this column.

The Microprocessor, a Biography

I don't know about you, but I read history for the stories. Fortunately for me, Malone writes history as a bunch of stories. All the memorable stories of the birth and twenty-something life of the microprocessor are here, usually gleaned from Malone's many interviews with all the movers and most of the shakers, but a few no doubt overheard at the legendary Wagon Wheel restaurant, which often played the role of the Ryder van in the moving and shaking in Silicon Valley's wild early years.

The book provides some interesting wrinkles on the founding of Silicon Valley. Most of that story is familiar: How William Shockley took his Nobel Prize, left Bell Labs, and went home to Palo Alto. How he founded Shockley Laboratories to make himself rich and attracted the best scientists in the field. How he quickly drove out his eight best scientists, including Gordon Moore and Bob Noyce, all of whom went out and founded Fairchild. Or were these scientists at fault? Were they "the Traitorous Eight," as they have been called? Malone more than hints at the answer when he speaks of Shockley's paranoia and labels him a "rotten boss."

Malone wades right into the credit thing: the recurring debates over who actually created the microprocessor. I needed some reminding, at least, as to the role of Federico Faggin vs. Ted Hoff at Intel. Faggin, who left Intel in 1974 to start a competing company (Zilog), more or less faded out of Intel's official history of the microprocessor. Malone sets the record straight, telling who did what and concluding diplomatically by labeling Faggin the creator, and Hoff the inventor, of the microprocessor.

That, of course, is only the intra-Intel credit controversy. The fact remains that two Texas Instruments scientists, Michael (another one) Cochran and Gary Boone, were granted the first "microcomputer" patent. Why Malone, and most of the world, gives credit for the invention of the microprocessor to Intel's effort is something Malone covers.

And suddenly in 1990, from out of nowhere, comes one Gilbert Hyatt, a virtual unknown, who claims to have invented the microprocessor over twenty years earlier, and has the patent to prove it. As it turns out, he was not unknown to Bob Noyce and Gordon Moore. Malone covers it all.

Malone writes knowledgeably of the crazy period when the bottom fell out of the calculator market. Although Hewlett-Packard doesn't normally break out revenues or profits for particular product lines, Malone was working for HP's calculator group from 1977 to 1979, so he is able to detail exactly how HP managed to ride out the storm and face down TI's "scorched-earth policy." That was the same scorched-earth policy, incidentally, that drove MITS out of the calculator business and inspired Ed Roberts to build the Altair computer that launched the personal-computer revolution.

You'll find Moore's Law in The Microprocessor: A Biography in several forms, and neatly graphed. It looks good to me, but I'll defer to DDJ contributor Hal Hardenbergh on the question of whether or not Malone got it right. Hal, who has documented many misinterpretations of Moore's Law over the years, may or may not be the absolute final authority on the issue, but I wouldn't dare contradict him.

Malone's book tells its stories with a proper appreciation for their drama. Probably the most dramatic moment in the book comes, believe it or not, during a slide presentation by an HP exec at a trade show. The speaker started his presentation slowly, then dropped the bomb. In Malone's words, "Based on its testing of U.S. semiconductor deliveries versus those from the Japanese, the latter were not just superior in quality, but shockingly so." The difference in failure rates was on the order of 5 percent from U.S. vendors versus no failures at all from Japanese vendors.

The period that followed this revelation was not pleasant. Former antiprotectionists in the U.S. ran crying to the government for help. Japanese executives began speaking of the U.S. as a dying and decadent society. Ugly.

How the American semiconductor companies responded is a fascinating story, one of many good stories Malone tells. Not only did I enjoy this and the other stories in this book, I also found that I learned a lot that I didn't know from Malone. Say, brother, you can't beat that with a stick.

Although Malone occasionally mentions his own history (like his HP job) in a footnote, the book is never in danger of becoming The Microprocessor: An Autobiography. Don't you just hate authors who are always inserting themselves into their writing? I know I do.

Here are the vital statistics: The Microprocessor: A Biography, by Michael S. Malone, 1995, Springer-Verlag (TELOS, Santa Clara, CA), 333 pages, $29.95.

Cheapo Bizarre Languages

What follows is the first installment of an ongoing survey of cheapo bizarre languages. Okay, some of these are cheap, some are free, and some are less bizarre than others. Basic, for example, can hardly be called bizarre, although the implementation described here may qualify. Forth is bizarre enough, but I want you Forth fanatics to know that I mean that in the nicest possible way.

This installment might be called more accurately "The State of Programming Paradigms: Part I: Public Domain and Shareware Languages for the Macintosh that Embody Alternative Programming Models; Section A: Basic and Forth; Including Some Historical Background."

In any event, this is a very selective overview. It won't deal with, say, the special needs of embedded-systems programmers. It will present evidence that there's more to programming than C, more than C++ even. The languages I am examining in this installment all exist on the Mac, though some that I'll discuss in later installments are available on other platforms as well.

Cheapo Basic

Before the Mac was released in 1984, it was clear to any right-thinking person that the first high-level programming language for the Mac would be Basic. In the early 1980s, it was a foregone conclusion that you supplied a Basic with any new machine. The only questions were, interpreted or compiled, disk-based or in ROM, Microsoft's or your own or somebody else's.

Apple decided to pursue two routes: It encouraged Microsoft to develop a Basic for the Mac, and it put Donn Denman to work on Apple's own MacBasic. Microsoft's Basic was delivered on time, but it was godawful. MacBasic, which was due for delivery within a few months of the Mac's release, was clearly going to kill Microsoft's Basic dead.

Microsoft took immediate action: Using the leverage of its licensing agreement over AppleSoft Basic for the Apple II, Microsoft demanded that Apple kill MacBasic. This may not have been a very bright move for Microsoft, since it could have renegotiated its AppleSoft license for almost any amount at that point, a fact that Bill Gates has since acknowledged. But instead it pressured Apple to kill MacBasic, and Apple caved.

It's easy to paint Microsoft as the heavy in this (although Apple management looks worse for knuckling under), but the story of Microsoft's influence on the Mac is too complex for such simple characterizations. One example: A key feature of the original Mac file system was apparently actually taken, with Bill's blessing, from his file-allocation scheme for Standalone DOS.

Let the dead past stay buried, you say? Ah, but like a rodent from the grave rises Chipmunk Basic, described by its author, Ronald Nicholson (rhn@netcom.com), as "a simple Basic interpreter...similar to the line-number based MumbleSoft BASIC interpreters of circa 1980." Yes, friends, here's that Basic interpreter for the Mac that you've been wanting all these years, accelerated for the PowerMac.

Understand, this is not a language for producing fast, bullet-proof, commercial-quality code. It began life in humble circumstances, out of the need for a Pascal program to test a Pascal-to-C translator called "p2c." The Pascal program, basic.p, was part of the test input suite to p2c.

But while it's not what you'd call fast, Chipmunk Basic runs 150 to 200 times faster on a PowerMac 7100/80 than Microsoft Basic 1.0 did on the original, 128K Mac.

If you need a relatively traditional Basic, this one is fairly solid and it's free. It has some features that make sense in a 1980-vintage Basic, like sprite graphics, an old-fashioned line-number-based editor, a predictable collection of numeric and string operators and functions, and file I/O statements. Its two variable types are long float and string, the latter with a maximum length of 254 characters.

But seriously, why would you ever want to use Chipmunk Basic?

Well, it also has some features you wouldn't expect. It supports AppleScript's DoScript command, for example, so you can drive your Chipmunk Basic programs with scripts. And you can do an open "SFGetFile" for input as #2 to use Apple's sfGetFile; ditto for SFPutFile for output. Or you can do an open "COM1:" for input as #3 or an open f$ for data input as #4 where f$ references a data file.

There's a say command that speaks strings if you have the Speech Manager installed, and you can save and restore variables with push(x,y,a$) : gosub 200 : pop 3. There's also a construct similar to awk fields: a$ = field$("aa bb cc dd", 2, " "), which suggests one purpose for which you might use any of these cheapo bizarre languages--as a so-called little language.

In his "Programming Pearls" columns and books, Jon Bentley has popularized both the term and the concept of little languages, those small programming systems that you use for just-bigger-than-back-of-the-envelope calculations, quick tests of ideas, aides to thought. Bentley's little language of choice, is, of course, awk. Bentley evidently thinks in awk. But if you're one of us who were once warped by Basic and never altogether recovered, maybe, in unguarded moments, you still think in Basic. If so, maybe Basic should be one of your little languages of choice.

Cheapo Forth

Although there was no Basic on the first Mac, this was no great handicap, since Apple didn't intend for anyone to write programs for the Mac on the Mac anyway. The development platform for the early 128K Mac was a Lisa.

There was, however, in the early months of Mac availability in 1984, a programming language that allowed developers to write programs for the Mac on the Mac. It produced fast code and gave access to nearly every routine in the then-64K ROM. The language was MacForth, from Creative Solutions.

Forth lives on today on the Mac in various implementations. Two free versions are MacQForth and Pocket Forth.

MacQForth is a voice from the apparently-not-quite-dead past. Its author, Ronald T. Kneusel (rkneusel@post.its.mcw.edu or kneusel@msupa.pa.msu.edu or rkneusel@carroll1.cc.edu, take your pick), claims that its chief use is as a tool for teaching Forth, and he has included some excellent tutorial materials.

It has another use, however, due to its heritage: It's also a decent tool for learning 6502 assembler. QForth itself was written for the Apple IIe by Toshiyasu Morita. MacQForth is basically QForth plus a 65C02-microprocessor simulator. For the most part, the code in MacQForth is identical to the code in the Apple II version. MacQForth programs think they're running on an Apple II.

Running QForth on the simulator has the advantages that the system is small and easy to learn, and not only is all of Forth available, but an entire microcomputer environment is available as well, including a system monitor and 6502 assembler.

An aside: The 6502, Chuck Peddle's invention and Steve Wozniak's obsession, lives on. MOS Technologies passed it on to Synertek, which passed it on to Rockwell, which passed it on to Western Design Center, which lists among its current customers AT&T, ITT, Sony, and Siemens. Who'da thunk the 6502 would be among the survivors of the chip wars? This data courtesy of Mr. Malone's aforementioned book.

Return from aside: Pocket Forth is a Forth implementation that requires the MDS assembler. MDS, Macintosh Development System, is Apple's now-discontinued 68000 assembler. Consulair apparently also sold an assembler that is compatible with MDS.

Pocket Forth is interesting because it supports the required suite of Apple Events and can define new Apple Events. This means that Pocket Forth can be scripted by scripts running in Userland Frontier, HyperCard, and AppleScript. Its author, Chris Heilman (heilman@pc.maricopa.edu), sees this as important. To show off Pocket Forth scripting, he has supplied a text file to define three new events, a HyperCard stack to demonstrate the events, and a Frontier install script that facilitates writing Frontier scripts to control Pocket Forth.

Cheapo Neon

One of my all-time favorite languages was Chuck Duff's Neon, an object-oriented language based on a kernel written in Forth and assembly language, sold by Kriya Systems between 1985 and 1989. Chuck learned a lot in writing Neon, and brought that experience to the more sophisticated language Actor some time later. Despite some rough edges, though, Neon was a fun language, combining the speed and extensibility of Forth with (some of) the virtues of Smalltalk.

Neon lives on, too, since Kriya Systems released all the source code to the public domain. Two free descendants of Neon are Mops and Yerk.

Mops is an object-oriented programming system derived from Neon. The latest Mops release includes various ex-Neon classes that author Michael Hore (mikeh@zeta.org.au) converted, as well as a number of other classes he wrote over the years. He has released all original Mops material into the public domain. If you want to use it commercially, that's fine, although he'd like you to let him know about it.

Yerk is a Neon derivative, too. It has been maintained by several programmers at The University of Chicago since the demise of Neon as a product. The name Yerk is not an acronym for anything, but rather stands for Yerkes Observatory, part of the Department of Astronomy and Astrophysics at U of C. Bob Loewenstein at Yerkes Observatory (rfl@yerkes.uchicago.edu) distributes Yerk under Kriya's release statement:

Kriya Systems, Inc. gives you [me] the permission to freely distribute for scientific and educational purposes the programming language formerly known as Neon, including the distribution of the source which has been released to you. You do not have the right to use the name Neon, as it apparently had prior use by another company and is not a valid trademark of Kriya Systems. All commercial distribution rights are reserved by Kriya Systems, Inc.

He takes this to mean that Yerk can't be sold.

Appealing features of Yerk, some of which are shared by Mops, include:

  • Defaulted early binding, with the ability to late bind in almost any circumstance.
  • Dynamic instantiation of objects on the heap.
  • Single inheritance.
  • Floating point (SANE).
  • Many system classes and objects for Mac interfacing.
  • Module (overlay) creation that is loaded only when necessary and may be purged from the application's heap memory.
Loewenstein has a number of general classes for color Quickdraw interfaces, MacTCP classes, and the like, that he's willing to make available to people who contact him.

All current languages discussed in this column are available on various online services and on the Apprentice CD series from Celestin Company (Port Townsend, WA).

Next month, even more bizarre languages.


Copyright © 1995, Dr. Dobb's Journal


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.