Slashdot Mirror


Forth Application Techniques

oxgoad writes "Sun Microsystems, Federal Express, the National Radio Astronomy Observatory -- what do they have in common? All have used, or are currently using, the programming language Forth in critical subsystems of their products or processes. 'What is this language Forth?' you ask. Forth has been called 'One of the best-kept secrets in the computing world.' Read on for a review of the book Forth Application Techniques authored by Elizabeth D. Rather." Forth Application Techniques author Elizabeth D. Rather pages 148 publisher Forth, Inc. rating 5 reviewer oxgoad ISBN 0966215613 summary A concise introduction to the Forth programming language.

Who & What

Elizabeth D. Rather, president of Forth, Inc., would appear to be the second Forth programmer in the universe. This distinction came about in 1971 when she was brought in at the Kitt Peak NRAO to maintain code written in a quirky language developed by Chuck Moore. Running on a DDP-116 and a H316, this code was responsible for controlling the telescope, data acquisition, and graphical display. After a few years, Moore and Rather, along with Edward K. Conklin, formed Forth, Inc. to attempt commercialization of the language.

Forth Application Techniques attempts to provide a comprehensive introduction to the language for the neophyte Forth programmer. I would say that it pretty much succeeds as such, quietly plodding away through each primitive and feature. It is written in workbook style with various sample problems for the reader to complete. You might not be a Forth coder after reading the book cover to cover; however, you will have a working knowledge of the language and should be able to walk through legacy code with a minimum of difficulty.

If I might step aside from my role as unbiased book observer for a moment, I would like to make a few comments about the state of programming languages in general. It seems that quite often we take for granted essential, but practically invisible, tradesmen such as plumbers and garbage collectors. (Fire your janitor and your web designer -- guess which one you will miss first. Guess which one will still be employable 15 years from now.) Yet, without their services, our daily quality of life would certainly fail to meet our expectations.

Likewise, Forth seems to be an invisible language. No flash, no e-commerce, and no glamour. Such is the nature of embedded systems -- even though every Federal Express delivery driver carries a Forth-based device on his belt. This appears to have resulted in a dearth of quality books dealing with Forth. Search your favorite online book retailer and note the dozens of Forth books that are no longer in print.

While Scheme is from the ivory tower and Forth might be said to be from the machine shop, they do have something in common that is a possible deterrent to the popularity of Forth. Like Scheme, you either get Forth -- or you don't. Stack-based languages leave some programmers dazed and confused. And, as with most languages, it is possible to write some truly obfuscated code. Any language that will allow you to define the number 4 as a word that places the number 3 on the stack can be a frightening weapon in the hands of the contrary.

Kudos

Forth Application Techniques can be commended on its consistency. Careful attention has been given to typefaces to distinguish interpreter output from user input. All primitives and defined words are covered in a clear and unambiguous manner. The book is spiral bound in a plastic binding, and this lay-flat binding is great when using it at your computer or while eating lunch.

Quibbles

The same lay-flat spiral binding that is such a boon when working at the computer can be somewhat of a nuisance when when attempting to hand-hold the book -- the book tends to flop about and feels very insubstantial.

While Forth Application Techniques is very complete and accurate, it is also extremely passionless. You might compare it to a biology textbook discussion of sexual reproduction with no mention of romance. There is no discussion or examples of using Forth in ways that will bring enlightenment. To be fair, in the preface it states that the purpose of the book is to support Forth classes taught at Forth, Inc. This is something that is not entirely clear when examining online retailers' display of the book.

Also of note is that there are occasional features specific to Forth Inc.'s SwiftForth product documented in the book. I would not consider this a real issue as all instances are clearly denoted with an icon. With the exception of chapter 9, which is entirely Forth Inc. specific, the readability is not affected in any way.

Crimes

Forth Application Techniques has no index. With its workbook styling, most will not consider this to be a tragedy. All the same, it would be convenient to look up primitives and defined words.

Conclusions

Should you buy this book? That depends on your desired end result. It is adequate for a quick introduction to Forth. If you are intending to write production code I believe Forth Programmer's Handbook (from the same publisher, review forthcoming) would be a better choice. If possible, I would supplement either with a used copy of Leo Brodie's Starting Forth -- an out-of-print classic.

Where I foresee this book to be a great benefit is in ordering a half-dozen copies for your programming team prior to taking on a legacy project or when considering Forth as a new development platform. The members of your team that "get it" can then enlighten the others with this invisible language.

Table of Contents

  • Preface: About This Book
  1. Introduction
  2. Simple Forth Primitives
  3. Structured Programming In Forth
  4. Data Storage
  5. Strings And Characters
  6. Number Conversion
  7. Vectored Execution
  8. Advanced Concepts
  9. Multitasking
  10. Style Recommendations
Disclosure

I received a review copy of this book from the publisher. Thus, my loyalties and opinions may be completely skewed. Caveat Lector.

Forth Application Techniques is available from Forth, Inc. and from some online merchants like Amazon. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

19 of 255 comments (clear)

  1. So two of us own that book :-) by redbaron7 · · Score: 5, Informative
    I bought this book a couple of years ago, when I had an idea for a project which I thought could benefit from a Forth-style system. In those days I did a lot more at-home dabbling which I just don't have time for now, and that idea has gone by the wayside.

    If you have any questions for Elizabeth Rather, she can be found on Usenet. When I asked for an "introductory book for modern Forth" I believe she recommended her own book! :-)

    Threaded Interpretive Languages (TILs) such as Forth have very elegant inner workings. I even wrote one as a kid. And I actually used it for a few months. Although my Forth-inspired TIL was limited to 16 bit integer math (on an 8086 I think it was), I still managed to get it to draw 3d wireframe graphics in real time on a PLUTO graphics card :-)

    RB

  2. Jupiter Ace by PHAEDRU5 · · Score: 3, Informative

    Back in the days of yore, when the world was still mostly in black and white, and strange man-eating beasts wandered the land, a small British company brought out a cute little computer called the Jupiter Ace.

    It was basically a Sinclair ZX-80, but with Forth in ROM, instead of BASIC. It was a fun little thing to play with.

    I may still have mine in a box in the attic. Must go check.

    --
    668: Neighbour of the Beast
  3. and Apple by Anonymous Coward · · Score: 1, Informative

    Apple uses a variant of OpenBoot called Open Firmware for all power macs released since the 7200/75. It, too, runs off of f-code.

  4. Forth is alive every time you print by LineGrunt · · Score: 5, Informative

    Postscript is based on Forth. You can "program" Postscript...

    Don't know why a non-printer driver person would want to, but you can...

    -LG

    1. Re:Forth is alive every time you print by bunratty · · Score: 4, Informative
      Postscript is based on Forth. You can "program" Postscript...

      Don't know why a non-printer driver person would want to, but you can...

      Using PostScript you can send a very small text file to the printer and have it print some amazing graphics. I used it years ago to draw dragon curves (a type of fractal), charts, and text that followed a wavy line for a poster.

      PostScript isn't really based on Forth. It's just another stack-based language, as is the language used for HP calculators, and virtual machines such as Java bytecode and .Net CIL.

      --
      What a fool believes, he sees, no wise man has the power to reason away.
  5. Re:Nice to see some current action by Anonymous Coward · · Score: 2, Informative

    Forth seems to keep hanging on. Here is a port to the Palm Tried figuring it out a full times, but it never stuck (pages, etc.) ...

  6. Open Firmware by Mikey-San · · Score: 4, Informative

    Forth is still in heavy use, actually, as the language for Apple's Open Firmware (IEEE-1275) implementation:

    http://developer.apple.com/hardware/pci/

    Oh, huh? I was supposed to make a point? Whoops. :-)

    -/-
    Mikey-San

    --
    Mikey-San
    Karma: +Eleventy billion (mostly affected by watching Celebrity Jeopardy)
    1. Re:Open Firmware by Draoi · · Score: 4, Informative

      Here's the official site & here's Sun's lesser-known public OF site ....

      --
      Alison

      "It is a miracle that curiosity survives formal education." - Albert Einstein

  7. and also by mirko · · Score: 3, Informative
    Sun Microsystems, Federal Express, the National Radio Astronomy Observatory -- what do they have in common? All have used, or are currently using, the programming language Forth in critical subsystems of their products or processes."

    And also Adobe who really got inspired for this when designing the Postscript language too...

    Concerning Sun there have been at least 2 uses :
    1) for their boot manager
    2) for the Java Virtual Manager which is a stack language based-environment.
    --
    Trolling using another account since 2005.
  8. Re:the inevitabele Forth/Jupiter Ace comment by rmolehusband · · Score: 3, Informative

    OK, so things are sluggish at work.

    A quick trawl came up with the following 'Nix based
    emulator

    --
    Reginald Molehusband. Edinburgh, Scotland
  9. Re:whoo Forth! by pldms · · Score: 2, Informative
    I had heard that Sun use forth for their OpenBoot proms...

    Yep. Sun use Open Firmware, as do Apple Macs. Open Firmware (or IEEE-1275 - those wacky IEEE names) uses Forth. Even if the rest of the machine is hosed you'll still be able to use forth. Err - great :-/

    --
    Slashdot looked deep within my soul and assigned
    me a number based on the order in which I joined
  10. Re:Jupiter Ace by yesod · · Score: 2, Informative

    There's a nice FAQ and emulator on this site here

  11. availability ? by mirko · · Score: 2, Informative

    I just went through amazon.com web site and I regret that most (if not all) Forth books written by Leo Brodie are out of stock...
    I remember waiting until 4 months to get a copy of "thinking forth", by the way.

    Now, if you want to learn forth, there seem to be the gforth manual, at least...

    --
    Trolling using another account since 2005.
  12. Forth was created on punch cards by dancomfort · · Score: 2, Informative

    Some of Moore's trial runs for Forth ran on Burroughs mainframes and were actually implemented as card decks.

  13. Elizabeth Rather by Draoi · · Score: 5, Informative
    I had the honour to meet Elizabeth at Apple during an OpenFirmware/FCode training course. She's an amazing teacher & is one of the first people ever to use the language, having worked with Chuck Moore in the late 60s ....

    She now works with Forth, Inc. Check out forth.com. They have an excellent history of the language here. BTW, there are free Forth interpreters for just about every platform out there. It's a cool language.

    Chuck Moore's own site is here

    --
    Alison

    "It is a miracle that curiosity survives formal education." - Albert Einstein

  14. Public domain pForth by senahj · · Score: 2, Informative

    If you want to fool around with FORTH
    on your own and for free, take a look at
    Phil Burk's
    public domain pForth

    --
    Wait a minute. Didn't I say that on the other side of the record? I'd better check ...
  15. url for colorForth by wkitchen · · Score: 3, Informative

    Chuck Moore's home page:

    http://www.colorforth.com

  16. Starting Forth is a Must! by farrellj · · Score: 3, Informative

    Leo Brodie's is one of the best books to learn Forth with. And the cartoons in it are the funniest/best in a manual that I have seen since the first Wizardry Manual!

    ttyl
    Farrell

    --
    CAN-CON 2019 - Ottawa's only book oriented Science Fiction Convention! October 18-20, Sheraton Hotel, Ottawa, Canada h
  17. Forth used in financial market reporting by exratio · · Score: 2, Informative

    I used to work for a company that deals with real time equity market data web sites: all runs on a custom Forth back end and web application server. CNBC ran on Forth for a year. Fortune Investor, Citibank, American Expresss -- all ran on Forth. www.wallstreetcity.com -- still running on Forth. Reason