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.

255 comments

  1. What they have in common by Doctor+Sbaitso · · Score: 1, Funny

    Sun Microsystems, Federal Express, the National Radio Astronomy Observatory -- what do they have in common?
    They all take our money and give us nothing in return?

    --

    ---
    Hello, Slashdot user. My name is Dr. Sbaitso. I am here to help you.
    1. Re:What they have in common by Anonymous Coward · · Score: 1
      What do you mean give us nothing in return? The last time I paid Sun I got a very nice computer in return.

      Oh, you mean like source code in return? Why should they give you code when people are happily paying for binary only code?

    2. Re:What they have in common by cduffy · · Score: 3, Interesting

      It's entirely possible to make money working on free software -- that's what I've done for the last two years.

      That said, the parent poster is indeed an idiot. Much commercial software is worth buying, and not all products can be economically written and supported as open source.

      Incidentally, I interpreted the "give you nothing in return" thing a bit differently wrt Sun -- their machines really don't have the same value proposition as many others (Intel-based systems on the low end, IBM's big iron on the high end), and I took the (great?) grandparent to be painting a somewhat exagerated carciature of that.

    3. Re:What they have in common by Anonymous Coward · · Score: 0

      I guess you're referring to Sun's stock price, huh?

    4. Re:What they have in common by c13v3rm0nk3y · · Score: 1

      FedEx delivered me a package. I hardly paid anything at all for the privilege.

      Got to sign with that nutty stylus, too.

      --
      -- clvrmnky
    5. Re:What they have in common by elphkotm · · Score: 1

      As an employee of FedEx, I can say that it's truely scary that we have anything like Forth anywhere... It's difficult enough for us to understand and implement Java.

      --

      <Amanda`> I just went out to the parking lot in my bathrobe to exchange warez CDs.
  2. whoo Forth! by stevedc2000 · · Score: 1

    Jeez, I can remember having a Forth compiler for my Commodore 64!!!!

    I had heard that Sun use forth for their OpenBoot proms...

    1. 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
    2. Re:whoo Forth! by Britissippi · · Score: 1
      Amen! I had a forth compiler for my Sinclair Spectrum. It was actually the second language I (tried) to learn after BASIC. As I recall, there was a nice glossy ad for the FORTH book and tapes inside the instruction manual for the ZX Spectrum + I was the proud owner of... ahh... those glorious halycon days... *sniff*

      So, its been around a while! Can of Quattro, anyone?

      --
      Meow meow meow meow, meow meow meow meow...
    3. Re:whoo Forth! by porkchop_d_clown · · Score: 2

      I think I had the same cartridge. Why would anyone want to use a write-only programming language today? Why not use APL while your at it?

      Seriously, Forth had solid advantages when RAM and processor cycles were at a premium. But these days few people have to develop for a 4k environment.

  3. Nice to see some current action by nurb432 · · Score: 2

    Not that forth is dead by any means, but it has sort of lapsed into obscurity.

    Nice to see recent development is still happening,
    as forth always has been the best for what its designed for, controlling stuff. Probably always will.

    Plus its sooo cool :)

    --
    ---- Booth was a patriot ----
    1. 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.) ...

    2. Re:Nice to see some current action by Draoi · · Score: 2

      Every time you use a PCI card with an FCode driver, you're using (bytecode) Forth. There's a lot of it about down at the hardware level .....

      --
      Alison

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

  4. the inevitabele Forth/Jupiter Ace comment by rmolehusband · · Score: 2, Interesting

    Every time I read about Forth it takes me back, I had a Jupiter Ace as a kid. Sad to say that it was easier to get my ZX81 to do cool stuff so it got kind of neglected. Shame.

    Maybe it's time to google up an emulator and indulge in a bit of notsalgia.

    --
    Reginald Molehusband. Edinburgh, Scotland
    1. 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
    2. Re:the inevitabele Forth/Jupiter Ace comment by lazarus · · Score: 1

      Odd that you should mention that. Forth was one of the few language options for my 1K (yes, that's 1024 bytes kids) Sinclair ZX81 after the BASIC interpreter it came with and, of course, native assembly.

      So I began to learn Forth. I don't recall much of the details, although I do remember finding it to be a very interesting language.

      I wonder, considering its history, why it never became the preferred language of embedded devices or PDAs?

      --
      I am not interested in articles about life extension advancements.
    3. Re:the inevitabele Forth/Jupiter Ace comment by sofayam · · Score: 1
      My first computer was an Ace. It came with a book which did a pretty good job of explaining programming to the beginner. One year later I got my first job in the industry and was wondering what all the fuss was about when people were talking about "modular code."

      Nearly twenty years later and I haven't come across a more productive environment for small embedded projects.

      ----

      --
      sofa -- so good
    4. Re:the inevitabele Forth/Jupiter Ace comment by RevAaron · · Score: 2

      I wonder, considering its history, why it never became the preferred language of embedded devices or PDAs?

      For the same reason Smalltalk didn't become the preferred language of writing end-user apps, and for the same reason Windows is the dominant OS, and why the versions of Windows with the widest share of the pie (52%) is based on DOS-

      backwards compatibility, of mind and software.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  5. Jupiter Ace by Anonymous Coward · · Score: 2, Interesting

    This was my first home computer - and it ran Forth. I won it in a competition in Popular Computing Weekly back in 1982. I never quite figured out how to program it, because my ZX-Spectrum 48k arrived the next day. Maybe if my sinclair had been delayed I would have taken the time learning how to write Forth, and perhaps by now I could have programmed my own Radio Telescope (which has to be the ultimate way to cheat at SETI@home) :-)

    1. Re:Jupiter Ace by yesod · · Score: 2, Informative

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

    2. Re:Jupiter Ace by turgid · · Score: 1

      Cool! I had the Skywave Software multi-tasking FORTH ROM for my ZX81. It was a drop-in replacement for the 8k BASIC ROM and contained multi-tasking (real-time) FORTH. I had both ROMS installed on a daughterboard that slotted into the ROM socket and a switch to select between the two. It's still at my parents'...

  6. 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

    1. Re:So two of us own that book :-) by sg_oneill · · Score: 2

      Indeed, due to the mindbending simplicity of the language... everything a stack op... writing compilers and interpreters are stupidly easy (actually a true forth compiler is a bit of a wierd gig when you think about it... forth sorta has the smalltalk-like "environment" vibe about it generally ...
      Remember whipping one up in Qbasic , of all things, to pump code for a little Z80 op system I was working on... Took an afternoon to get the compiler to work.. Toooooo easy.

      --
      Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.
  7. Sun OpenBoot sucks by Anonymous Coward · · Score: 0
    I had heard that Sun use forth for their OpenBoot proms

    Yes, indeed.

    And that's why you can't use commodity SCSI cards in Sun architecture. The stupid OpenBoot expects to find Forth interpreter on the card which only the high end, Sun approved cards have.

    1. Re:Sun OpenBoot sucks by Anonymous Coward · · Score: 2, Insightful

      No, it expects to find a some forth-like bytecode. The interpreter's part of OpenBoot. The market is stupidly stratified, by the way.

      OpenFirmware is defined for the X86 architecture too - just motherboard manufacturers stick with proprietary PC-BIOS clones like PhoenixBIOS and AmiBIOS instead of OpenFirmware, so card manufacturers keep putting x86 assembly language into their BIOS blocks instead of OpenFirmware code.

      Remember, the PC-BIOS and x86-architecture is a massive kludge! Why would you expect a Sun architecture to be able to run, AT BOOT TIME, x86 BIOS drivers?

    2. Re:Sun OpenBoot sucks by drightler · · Score: 1

      I bought a perfectly fine Compaq PCI SCSI Controller with a Symbios chipset off Ebay for about $20, it boots my Ultra5 just fine.

      --

      blah blah blah....
      drightler@technicalogic.com
    3. Re:Sun OpenBoot sucks by Anonymous Coward · · Score: 0

      Why would you expect a Sun architecture to be able to run, AT BOOT TIME, x86 BIOS drivers?

      Other than suckitude, Why not? DEC did it for many Alpha machines.

  8. No Thanks by acehole · · Score: 5, Funny

    Until I see a decent Language to switch to I'll stick to my punchcards.

    --
    Be you Admins? nay, we are but lusers!
    1. Re:No Thanks by Anonymous Coward · · Score: 0

      Let me guess... you're on AOL, right?

      LOL. That's shorthand for "LOL I'm on AOL and I am gay. You can tell because I say LOL a lot."

    2. Re:No Thanks by Anonymous Coward · · Score: 0

      Yes, and his line printer spits out "You've got mail!"

  9. Re:Early post by zapfie · · Score: 0, Offtopic

    Try fourth post.

    --
    slashdot!=valid HTML
  10. 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
  11. ha by haa...jesus+christ · · Score: 2, Funny

    review forthcoming, eh? what a mad little punster you are. ;)

    1. Re:ha by Anonymous Coward · · Score: 0

      s/pun/wordplay/

  12. 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.

  13. Slashdot broken? by Anonymous Coward · · Score: 0

    Could someone tell me why I can't post from home? I'm going through anonymizer here. Did some moron at Slashdot ban everyone?

    BTW: If some retard moderates this offtopic, how about you take a look at the tiny number of posts...there's a reason.

    1. Re:Slashdot broken? by Anonymous Coward · · Score: 0

      No, it's just written in Forth.

      ACTUALLY, I've got posts to metamoderate, and it won't let me! I feel so useless.

  14. 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 gilh · · Score: 1

      Recall the NeWS window manager on early Sun machines.

      http://www.art.net/~hopkins/Don/lang/NeWS.html

    2. Re:Forth is alive every time you print by Willard+B.+Trophy · · Score: 2, Interesting

      while it's true that PostScript and Forth use Lukasiewicz (Reverse Polish) notation, the former bears little resemblance in syntax to the latter. PostScript's a lovely and subtle language, but gets interesting when you're debugging an 800MB imposed printing plate ...

    3. Re:Forth is alive every time you print by xmath · · Score: 3, Interesting

      For some boring stats course we had a programming assignment "in a programming language of your choice".... big mistake

      since it was basically a simple statistical experiment + graphical output, I wrote it in PostScript.

      Kinda cool, it was a report with the statistical experiments embedded, so if you printed it twice, all the graphs were different :-)

    4. 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:Forth is alive every time you print by monopole · · Score: 1

      To paraphrase Don Lancaster "Postscript is an excellent general purpose programming language which occasionally gets a perfectly good piece of white paper" his website provides a large number of interesting postscript apps.

      As a postscript hacker I often find that in the process of programming the printer interface I end up doing the entire program in postscript! For example I have implemented maximum length linear shift register based pseudorandom number generators to form random optical masks.

      Using freestanding postscript programs is particularly useful for high resolution (>2500 dpi) raster image processors where file sizes can really get out of hand

    6. Re:Forth is alive every time you print by afidel · · Score: 2

      Then isn't everything from Next forth?

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    7. Re:Forth is alive every time you print by xmath · · Score: 1

      Oh, in case anyone wants to see what it looks like (since it's not easy to find a decent piece of hand-written PS in the wild):

      http://www.liacs.nl/~mavduin/mod1.ps

    8. Re:Forth is alive every time you print by unfortunateson · · Score: 4, Interesting

      % Save this as dragon.ps for 15 pages of
      % fractal iteration -- commented even!
      % define constant of 1/sqrt(2)
      /Scalefactor 1 2 sqrt div def

      % Define Fractal subroutine
      % usage: lvl Fractal stroke
      % Examples below are as if called with a level of 5
      /Fractal { % 5
      dup % 5 5
      0 eq % 5 false
      {
      % True condition: draws line segment
      pop 300 0 rlineto % -
      }
      {
      % False condition: recurse routine
      % set the scale factor
      Scalefactor dup scale % 5
      % On alternate iterations, level is set negative. When negative, reverse the angles
      dup -90 exch % 5 -90 5
      0 lt % 5 -90 false
      { neg exch neg exch } if % 5 -90 false
      % Recurse one level lower
      dup 2 div % 5 -90 -45
      rotate exch 1 sub % -90 4
      % Actually call myself again
      dup Fractal % -90 4
      exch dup neg % 4 -90 90
      rotate exch neg % -90 -4
      % Call second time for second stroke
      Fractal % -90
      2 div % -45
      % set things back to the original scale and rotation
      rotate % -
      1 Scalefactor div dup scale % -
      }
      ifelse
      } bind def

      % Loop to iterate 15 pages of fractal
      currentlinewidth 4 div setlinewidth
      0 1 15 { 200 400 moveto Fractal stroke showpage } for

      --
      Design for Use, not Construction!
    9. Re:Forth is alive every time you print by Doctor+Faustus · · Score: 1

      PostScript may be based on Forth in the modeled after sense of "based on", but it isn't implemented with Forth.

      Also, most people print with PCL these days, as it's free and PostScript adds to the printer cost.

      I have done PostScript programming for phone bills, because the PostScript my program can create, knowing the structure of the data, is a small fraction of the size that PostScript or PCL from a generic print driver would be.

    10. Re:Forth is alive every time you print by t · · Score: 1
      It's not very often I see something really neato as I sit here hitting reload in ggv.

      I've been working on my masters thesis on complex wavelets and I would love to embed some code into a pdf to be able to make it either interactive or calculate scaling functions (an iterative process) as you sit there and read the page, continually refining it until you flip the page (yes this would bork up a printer). This would be a tremendous space saving since the since of my eps files adds up.

      Previously I had been thinking of the feasibility of embedding something like java since I've seen some nice wavelet java demos, although I dislike java since it's not mature enough for someone like me who would have to maintain it for the next ten years. I had heard that you could embed basically shell scripts to launch anything you want from within the pdf but that no longer seems very portable to me.

      Perhaps forth is the answer since the computations are fairly simple and thus my learning curve would be limited.

    11. Re:Forth is alive every time you print by joto · · Score: 2
      Postscript is based on Forth.

      No, it isn't.

      You can "program" Postscript...

      Yes

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

      Mainly because it's fun. But also because you can make some useful scripts to process postscript. E.g. 2-up, double-sided to single-sided, adding page numbers, etc...

      But back to the first point. Postscript is to Forth as Python is to C (roughly). While Forth is an extremely low-level lanugage, Postscript requires a relatively heavy interpreter. A simple forth implementation can be made in a day, and a useful one in a week. PostScript requires much more effort (at least if you want it to be useful with a typical PostScript file). Forth is untyped, PostScript is dynamically typed. Forth has some nifty features making it a reflective extensible language (create does>), PostScript does not. In Forth, everything is a cell (pointer or signed or unsigned integer), PostScript has high-level datatypes like lists, code-blocks (anonymous functions), strings, fonts, etc... In Forth you typically allocate data on a stack, or once at the start of the program. PostScript is garbage collected. Forth is consistently minimal (whether you like it or not), PostScript is mostly high-level, but has some relatively unfriendly features such as fixed-size dictionaries to make it feel more unusable. Forth is easy to debug, and easy to crash your machine with. PostScript is hopeless to debug, but will rarely break anything serious. Forth is inherently unsafe, and is allowed to read/write any memory location, PostScript can be made safe enough to view random files on the web.

      I could go on, but it should be clear by now that about the only resemblance the two languages share is postfix syntax.

    12. Re: Forth is alive every time you print by Baldrson · · Score: 1

      If you can show that JaM had the advanced features you describe in Postscript I'll modify my Genesis of Postscript web page to quit my claim to quite possibly being involved with the genesis of that language -- although it may still be that my visit to PARC did have a catalyzing effect, seeing the visit was on behalf of one of the largest newspaper chains in the world. I've been unable to locate the language spec for JaM

    13. Re:Forth is alive every time you print by Permission+Denied · · Score: 2
      This discussion would not be complete without mention of the Obfuscated PostScript Programming Contest. Of particular interest is this entry, a raytracer in ten lines of code.

      I prefer keeping some anonymity on Slashdot (lets me rant more easily), but if you come across me on the Internet otherwise, you'll recognize me by my .sig, which is a three-line PostScript program (albeit not nearly as cool as the raytracer).

      PostScript is an amazing language - completely changed the way I thought about programming. Bored with systems-level C programming? Give PostScript a try....

    14. Re: Forth is alive every time you print by joto · · Score: 2
      Unfortunately I can't since I have never heard of JaM.

      On the other hand, the idea that an early ancestor of PostScript was more Forth-like doesn't sound too unlikely. Most likely it was, it seems like an obvious thing to use Forth for (embedded software, building a domain-specific language, etc...). Obviously, I wasn't around at that time, so I can't actually judge the truthfullness of your tale.

  15. Ah this is great! by TerryAtWork · · Score: 4, Interesting

    FORTH is an incredible language!

    I ran Miller Microcomputer Forth on a TRS-80 back in the day and it was amazing.

    Forth is totally stack oriented. It is difficult to determine where the OS ends and the language begins.

    It is naturally recursive.

    DONE RIGHT you can do a LOT in a few lines.

    You can shoot yourself in the BULLET with Forth.

    And Spiderman would code in Forth because...

    --
    It's Christmas everyday with BitTorrent.
    1. Re:Ah this is great! by wkitchen · · Score: 4, Interesting
      Forth is totally stack oriented. It is difficult to determine where the OS ends and the language begins.
      Operating systems are for wimps.

      Those old enough to remember early 8-bit home computers like the C64, TI99, and similar, may recall that many of these "booted" straight into a BASIC editor/interpreter that was stored in ROM. Nothing between you and the hardware except for this and some very low level rom code roughly equivalent to a BIOS. A VERY low-fat system. Compare that to the multiple levels of abstraction and bloat we have now.

      Ever think it might be sort of cool to run that kind of low-fat system on powerful modern hardware? Sort of like an ultimate C64 with, hundreds of megabytes of RAM, and many hundreds of MIPS. Maybe not pretty, but the raw computing horsepower at your fingertips would be awesome, provided you know the system well enough to use it. Replace that BASIC interpreter with the close-to-the-machine spartan efficiency of Forth, and it gets even leaner and meaner.

      Chuck Moore, the inventor of Forth, has created an interesting little critter called colorForth that does just this. Stick the floppy in the drive, turn on the power, and boot straight into colorForth. The system is at your command. No OS, other than colorForth itself. The most bloated piece of software on the machine is the BIOS.

      Just you. In complete control of your machine. What a concept.

    2. Re:Ah this is great! by sql*kitten · · Score: 2

      Ever think it might be sort of cool to run that kind of low-fat system on powerful modern hardware? Sort of like an ultimate C64 with, hundreds of megabytes of RAM, and many hundreds of MIPS. Maybe not pretty, but the raw computing horsepower at your fingertips would be awesome, provided you know the system well enough to use it

      Couldn't you do this by booting a modern PC into DOS? Running compiled C it would be blazingly fast, your program would get literally 100% of the machine's capacity.

    3. Re:Ah this is great! by wkitchen · · Score: 1
      Couldn't you do this by booting a modern PC into DOS? Running compiled C it would be blazingly fast, your program would get literally 100% of the machine's capacity.
      Well, yes. Or at least pretty close to the same effect. DOS (even just the part that stays in RAM) is bigger than the 2K colorForth core, but still miniscule relative to what's available on any modern computer. Good point.
    4. Re:Ah this is great! by Anonymous Coward · · Score: 1, Interesting

      Forth is more interactive than a DOS/C combo, and typcial forth systems have a set of de-facto standard cooperative multitasking keywords defined for subprograms within the forth environment.

      Forth "consumes" its input, as you type, words are evaluated. It's a little like a Lisp REPL in end-effect, though defined less formally.

    5. Re:Ah this is great! by bunratty · · Score: 2
      Chuck Moore, the inventor of Forth, has created an interesting little critter called colorForth that does just this. Stick the floppy in the drive, turn on the power, and boot straight into colorForth. The system is at your command. No OS, other than colorForth itself. The most bloated piece of software on the machine is the BIOS.
      You still use a bloated BIOS? I just wire together transistors and program in machine code with switches. Of course, it takes me days to do what my coworkers can do in seconds, but at least I'm in complete control of every bit and every cycle.

      Wimps!

      --
      What a fool believes, he sees, no wise man has the power to reason away.
    6. Re:Ah this is great! by Anonymous Coward · · Score: 0
      You still use actual transistors? Wimp!

      I design logic gates on paper and simulate them running in my head. Just think... you in control of every cycle, right inside you own head!

    7. Re:Ah this is great! by Anonymous Coward · · Score: 0

      You still use bloated paper? WIMP!!!

    8. Re:Ah this is great! by Anonymous Coward · · Score: 0

      0110101000101 010100010101010 01010000101010101 010001010100101010101111? 101110010101010101!

    9. Re:Ah this is great! by infinite9 · · Score: 2

      And Spiderman would code in Forth because...

      ... he hates web development?

      --
      Disconnect your television. Do your own research. Draw your own conclusions. They're probably lying. Don't be a sheep.
    10. Re:Ah this is great! by joto · · Score: 2

      You are using wires and transistors? I'm preferring to use something I have complete control of, not to be at the whim of wire and transistor manufacturers. My computer is made out of a bunch of buckets, ropes, and a large supply or running water. Of course, it takes me years to do what you can do in a second, but at least I'm in complete control of every liter of water.

    11. Re:Ah this is great! by Anonymous Coward · · Score: 0

      There was even a Slashdot interview with the guy a while ago.

  16. "best kept secret" by extremely · · Score: 5, Funny

    "Best kept secret" is actually a review for Forth, not the problem. If I'm going to have to deal with a stack, it should have butter and syrup on it.

    --

    $you = new YOU;
    honk() if $you->love(perl)

    1. Re:"best kept secret" by Anonymous Coward · · Score: 0
      If I'm going to have to deal with a stack, it should have butter and syrup on it.
      Don't be silly. You can't push syrup - it's too runny.
    2. Re:"best kept secret" by EvilBudMan · · Score: 1

      Yea,

      or a stack of Ben Franklin's

  17. crazy bugs by Anonymous Coward · · Score: 1, Interesting
    Any language that will allow you to define the number 4 as a word that places the number 3


    Fortran used to let you do that, but usually by accident.

    Parameters were *always* passed by reference (var in pascal or & in C++), so you couldn't pass a number constant. Compilers would create a table of constant values, though, and pass the address into the table. However, if the function modified the value, it modified the number "constant" entry in the table.

    1. Re:crazy bugs by c13v3rm0nk3y · · Score: 2

      The best Stupid Forth Trick I ever learned was changing the number based from octal, decimal or hex to an arbitrary number like 128 or 256 (decimal).

      Every single printable ASCII character becomes a number. Any language that allows you to define cntrl-G as a valid number you can compute with has to be on a hackers list of all-time favourites.

      Of course, changing it back again may be a bit of a challenge. For some reason, all my compiled words keep ending up on the stack...

      --
      -- clvrmnky
  18. Still Worth Learning by Anonymous Coward · · Score: 5, Interesting

    Forth is still great when resources are very limited... Palm OS programming, for instance. I've used it there and in several embedded systems projects without an underlying OS, and managed to run circles around a team coding for 8051-based systems in PL/M (I think that's the name of what they were using, but I'm not 100% certain).

    I also tried a version of Forth-83 for Windows by Ray Duncan's company, LMI. I tried to code up a DDE server, and while it worked, it was painful. I've come to believe that Forth is more trouble than its worth when interfacing to APIs designed for C. Such APIs are often poorly factored (relative to how you'd solve a problem in Forth), and take too many parameters of different sizes as arguments. Even with the Palm you jump through some of these hoops, but in that environment it's often worth the effort.

    The underlying principles of Forth are worth knowing no matter what language you program in... there's a lot of simplicity at its core, and it'll help you understand how to program for other stack based languages such as .NET's CIL. And nothing I've seen teaches factoring better than Forth (too bad Brodie's "Thinking Forth" is out of print).

    1. Re:Still Worth Learning by wkitchen · · Score: 1
      (too bad Brodie's "Thinking Forth" is out of print)
      I'm fortunate enough to still have my copy, as well as "Starting Forth". (And they're NOT for sale.) Brodie's Forth books are great. And "Thinking Forth" is a good read for problem-solving in general, even if you don't plan to program in Forth. A good acquisition if you can find it. I bought mine back when they were still in print.
    2. Re:Still Worth Learning by Waffle+Iron · · Score: 4, Insightful
      It's also worth learning just because it's one of the few languages that is simple enough that you can actually understand the implementation top-to-bottom. You could write a simple Forth interpreter in assembly language in a couple of days, just to educate yourself on how languages work. (I did this once for 16-bit X86s about 15 years ago).

      Forth is also an excellent example of "emergent behavior". Even though the language implementation is simple, the dynamic behavior can quickly becom mind blowing. I still have a hard time completely understanding the way some of the compiling "words" (which dynamically add syntax to the language similar to Lisp macros) work in Forth.

      If nothing else, Forth will teach you to factor your code into small procdures, because making a function longer than about 5 lines quickly becomes unreadable :).

    3. Re:Still Worth Learning by William+Tanksley · · Score: 2

      If nothing else, Forth will teach you to factor your code into small procdures, because making a function longer than about 5 lines quickly becomes unreadable :).

      True. One line is the recommended length -- but that one line holds something very different from what it would have to hold in C.

      Forth also has some interesting design details which result in function calls having much less overhead than function calls in C.

      -Billy

    4. Re:Still Worth Learning by fwarren · · Score: 1
      I would be even more radical, and suggest that unless you are planning on making a living at programming in FORTH, skip the post 1990 ANSI standard Forth and lean with a Forth 83 system such as F-PC for DOS (or better yet F83, which is simpler), or LMI Winforth for Windows. For Linux users you will have to use something like gForth, which is an ANS Forth.

      It is even a boon to windows programmers. I can create a program, and while it is running in one window, have a forth console window open where I can test the value of variables, send messages, and even change how a program responds to messages on the fly. I can't think of a better way to learn winodws.

      The beauty of learning Forth, is being able to apply factoring when you program in other languages. The best way to really learn to factor, is to use BLOCKFILES for editing your source.

      A blockfile presents your soruce code as blocks/screens each being 1K in size. That is 16 lines of text which each line being 64 characters in size. If you are writing one function, and find that this is not enough room, there is a 99% chance that you do not understand the problem well enough factor the problem down into small usefull functions (words in Forth).

      It is a pain in the butt to learn and use this way, but it is worth it. I write apps for MS Windows using Forth, and you would be hard pressed to find any word definitions that would be over 10 lines of code. Even though I use regular source files instead of blockfiles. The constraints they put on a new Forth programmer helps them learn the right way to do things.

      When writing under the hood stuff, my defintions are only 3 or 4 lines of text. When writing code that interacts with the windows API, I allow up to 10 lines or so for code, because you can't do much about the verbosity of hungarian notation and passing 5 and 6 arguments to API calls.

      I digress, back to the subject at hand. By learning Forth83, you will be able to take advantage of all the good books written about Forth in the 1980's. Even if you have to do an interlibrary loan, Leo Brodie's "Thinking Forth" is a must read. You will learn how to:

      1. How to ignore the superficiality of flow control
      2. Information chunking how to design software without it becomming to complex to understand
      3. How to design a program by components
      4. How to design a program that will easily survive change
      5. Move the work from runtime, to compile time. From Compile time to being done by the programmer (yes, sometimes this does make a program better)
      6. ICE Interpret, Compile, Edit - how to use it to your advantage.

      There is a certain design philosophy on how to write quick to prototype, easy to maintain software that is elegant. However, that philosophy is embodied in the language FORTH. By learning, understanding and following this philosophy when programming in Forth, will allow you to be a better programmer in other languages.

      Anyways, most of the above can be found in "Thinking Forth", well worth the effort to get the book.

      Bart Bucks are not legal tender

      --
      vi + /etc over regedit any day of the week.
  19. 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

    2. Re:Open Firmware by Canyon+Rat · · Score: 1

      Actually, it's Sun's Open Firmware. Apple just licensed it.

      For those just wanting to get a feel for the language, Apple has a small tutorial here.

    3. Re:Open Firmware by Mikey-San · · Score: 1

      Right, which is why I said "Apple's Open Firmware 'implementation'".

      La la la.

      -/-

      --
      Mikey-San
      Karma: +Eleventy billion (mostly affected by watching Celebrity Jeopardy)
  20. Ya' know, there's one well-known Forth codebase... by Anonymous Coward · · Score: 2, Interesting

    ...unfortunately, it's got it's own acronym, MUF, short for Multi User Forth. It's used on a sub-set of on-line Multi User Dungeons known as MUCK's, specifically all those based on the FuzzBall variant, which at this point includes a couple of notable ones such as ProtoMUCK.

    As a quick pair of references, check out the ProtoMUCK and FBMuck projects on SourceForge.

  21. 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.
  22. Apple too. by ZigMonty · · Score: 3, Interesting

    Apple's OpenFirmware also uses forth. Hold down Command+Option+o+f at startup and you are thrown into a Forth shell. How's that for a BIOS?

    1. Re:Apple too. by thesadmac · · Score: 0

      Bloody awful! You ever tried writing a boot prompt for it to allow you to choose between Linux/MacOSX on an Old World Mac?

      I have the prog lying round if anyone wants it. 4 lines of solid text with no breaks or anything. Forth is eviiiil.

    2. Re:Apple too. by sketerpot · · Score: 1
      If you wrote a Forth program that was four solid lines of text with no breaks or anything, then you are probably the evil one. Did you define your own words? Did you keep word definitions small? Did you factor out things to an extreme (as is customary in Forth)?

      If not, you probably should have done so.

    3. Re:Apple too. by Ciannait · · Score: 1

      Apple's OpenFirmware and Sun's obp (OpenBoot) are essentially the same thing. I don't remember who got which from whom, though.

      --
      A good traveller has no fixed plans and is not intent on arriving.
  23. 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.
    1. Re:availability ? by Anonymous Coward · · Score: 0

      Must be the /. effect on amazon.com. I wonder what will happen if you link a /. story to their 1-click "technology" link.

    2. Re:availability ? by jjga · · Score: 1

      I have a never used copy to sell of "Starting Forth" from Brodie, in case someone is interested.

    3. Re:availability ? by mirko · · Score: 1

      Iam !

      --
      Trolling using another account since 2005.
    4. Re:availability ? by c13v3rm0nk3y · · Score: 2

      Most of the Forth SW vendors carry copies of "Thinking...". Ask on comp.lang.forth about the (very outdated) FAQ which has a lot of refs to vendors, or just Google for 'em.

      --
      -- clvrmnky
    5. Re:availability ? by Anonymous Coward · · Score: 0

      You can still by Thinking Forth at Taygeta's site:

      https://www.taygeta.com/orderform.html

      think you do what ?

    6. Re:availability ? by mirko · · Score: 2

      Thansk but I already have it.
      This is starting Forth I am interested in.

      --
      Trolling using another account since 2005.
  24. FORTH - Source of PowerPC Boot Misery by Anonymous Coward · · Score: 0

    yea, FORTH is so neat and easy to use...

  25. Re:SUBWAY EAT FRESH by Anonymous Coward · · Score: 0

    Wanting to wear diapers has nothing to do with sex. It may turn you on, but that's not bad.

  26. NEON by jbaltz · · Score: 1

    Does anyone remember using NEON, an "object-oriented FORTH" for the Macintosh? I remember using that back in 1985 for a professor at Swarthmore College...back when it was actually a pretty fantastic programming environment for the Classic Macs.
    (This was at the very beginning of SANE too, and NEON didn't have any native fp code, so we had to hack that in in 68030 assembler. What fun!)

    --
    I am the Lorvax, I speak for the machines.
    1. Re:NEON by Anonymous Coward · · Score: 0

      NEON morphed into MOPS, which sadly seems not to have been updated for a while. http://www.netaxs.com/~jayfar/mops.html

    2. Re:NEON by gentlewizard · · Score: 2

      Yes, I had NEON running on my Mac SE 'way back then. It was a cool implementation, but the drawback (as with everything Mac) was the learning curve of the Mac architecture.

      Still, I have the Brodie book and even published an article in Forth Journal. The elegance of the language is amazing. I like the way that you don't so much program, as extend the compiler to include new words for what you want to do. Eventually, the compiler is so close to your problem domain that a few words in this new language will solve your problem.

      I miss it.

    3. Re:NEON by Anonymous Coward · · Score: 0

      My bad; I kinda let all my web sites go to seed a few years ago, but Mike Hore is still maintaining Mops, as he has for over a decade. Thankfully, I see a new Mops page has sprung up at:

      http://www.panix.com/~goshawk/Mops/

      Also see comp.lang.forth.mac

      Jayfar

  27. Re:SUBWAY EAT FRESH by Anonymous Coward · · Score: 0

    Greetings of the day.
    I accept this honor with solemnity and indemnity.

  28. Forth and others by StoatBringer · · Score: 0

    I used to have a Forth compiler for my ZX Spectrum.

    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.

    Hmm... If I remember correctly, early versions of FORTRAN allowed you to redefine TRUE and FALSE. Can you still do that?

    --
    Cress, cress, lovely lovely cress
  29. 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.

  30. Forth is a great hacker (classical sense) tool by unfortunateson · · Score: 2, Interesting

    In the late '80s, there was a sweet Forth implementation for the Mac called Mach 2. It produced native 68000 code -- unusual because most Forths produced an interpreted byte-code, but possible because of the 68000's stack orientation -- and was cheap (about $50).

    While it wasn't the easiest thing in the world to use for building complete GUI apps, it was a great experimental tool because it was essentially an interpreted assembler/disassembler! You could experiment with OS traps that were recently published but hadn't made it to other compiler implementations, and see what machine opcodes would do the job minimally.

    You could then take those opcodes and drop them into, say Turbo Pascal (which was barely supported by Borland) as inline machine instructions. Way cool.

    The other place where Forth came in handy was a couple several years later when learning PostScript: as a stack-based language, PostScript was a cinch to pick up. Of course, if you've been using RPN calculators, it shouldn't be too bad either.

    Forth may be a little low-level in these days when Perl and Python provide such abstract data types, but it makes you think closer to the hardware. When hardware control is an issue (in devices like telescopes, barcode readers, etc.), Forth beats programming in assembler by a long shot.

    --
    Design for Use, not Construction!
    1. Re:Forth is a great hacker (classical sense) tool by timcuth · · Score: 1

      Mach 2 - that is what I used on my Fat Mac. Yes, it was cool.

      Tim

  31. I used Forth, back in the day... by timcuth · · Score: 1

    ... on a Commodore 64 and an early Mac. At the time, it was the only "PC" language I was truly productive with.

    I remember writing an application I could use to program sheet music to be played by the 64's sound chip. I simply specified a voice, a note value, and a note duration (e.g., quarter note, half note, etc.) for each note in succession. I demonstrated it to my local Commodore users group and it got ooh's and ah's.

    I also have a copy of the mentioned book by Leo Brodie.

    Tim

  32. Religious experience to "get Forth"? Feh! by shaneb11716 · · Score: 1

    I almost bought a microprocessor running Forth recently, but I couldn't pull the trigger (IsoPod). I used Forth many years ago, and it seemed cool, but the problem I have with it is still there... even in this review, everyone always says Forth is great for embedded apps, but it can never be explained in a way that speaks to my inner geek.

    I just can't buy that you need to have a religious experience in order to understand why a language has benefits.

    -Shane

    --
    I love teh int4rw3b!!!!!111one1
  33. Re:Early post by HerringFlavoredFowl · · Score: 2

    Hey, you just rebooted my machine ...

    HI and HELLO in forth (depending on flavor) reboot.

    Can't wait to get my hands on the new book, we are heavy forth users.

    --
    TastesLikeHerringFlavoredChicken
  34. OH LOL by Anonymous Coward · · Score: 0
    I would put your daughter into pull- ups and leave the question alone for a while.

    Sometimes children are interested in toilet training, but not exactly ready emotionally. Try to find out what she doesn't like about the potty. It may be nothing more than unreadiness. She may have worries about something you can explain, such as where her bowel movement goes after the toilet is flushed.

    At any rate, be patient. She will train again! The easier the experience, the fewer accidents she will have later on. Many children, especially those who are attempting early training, regress for a time but train quickly when they are ready.

  35. Re:Religious experience to "get Forth"? Feh! by timcuth · · Score: 1

    >> I just can't buy that you need to have a religious experience in order to understand why a language has benefits.

    So, you've probably never tried Smalltalk, either?

  36. I thought they all used Brainf*ck! by Anonymous Coward · · Score: 0
  37. Computer languages are all the same by truth_revealed · · Score: 1, Interesting
    All computer languages rehash the same concepts:

    set/read variables

    conditional, branching and looping constructs

    call functions

    I see very little difference between:

    Lisp/Scheme's
    (my_function (+ a b))

    C/C++/C#/Java/Javascript's
    my_function(a + b);

    Forth/Postscript/other postfix languages
    a b + my_function

    or assembler:
    push a
    push b
    add
    jsr my_function


    It just boils down to syntax and ease of typing.

    It's interesting to note that C-style syntax seems to have won the popularity contest, though. Code is written in any of PHP, Perl, C, C++, Objective C, C#, Java, Javascript are easily understood by anyone versed in any language in the set.

    Most languages are stack based, but a few like Lisp and Javascript support the notion of closures. But even closures can be emulated in C of course via heap allocated memory and function objects. Indeed, you can emulate any computer language construct in any other computer language (with varying degrees of efficiency, of course).

    In the end, the computer language is usually chosen based on:

    popularity (because this implies support for the language and longevity for your system)

    ease of coding

    execution speed

    Too bad there does not exist a universal computer language compiler system whereby one could code in the computer language they prefer and check the code in and the next guy could check out the code in the language they prefer.

    1. Re:Computer languages are all the same by Anonymous Coward · · Score: 0

      Maybe all imperative languages are the same -- but where is your prolog example?

    2. Re:Computer languages are all the same by Anonymous Coward · · Score: 0
      "...All computer languages rehash the same concepts..."

      I don't mean this as a flame, but you clearly have to spend more time learning other languages. You've shown how to add integers in several different languages and make a function call... a rather trivial example, and one that does not showcase how the choice of language can alter your entire approach to solving a problem.

      For instance, what's the equivalent of Forth's CREATE/DOES> in any of those languages. You'll find that it's an entirely foreign concept to many of the languages you mention.

      You can't really choose the right tool for a given programming task until you learn a variety of tools and understand when and how they are best applied. There's a lot more to the proliferation of programming languages than superficial differences in syntax.
    3. Re:Computer languages are all the same by Anonymous Coward · · Score: 0

      Prolog's facts and rules are nothing more than a data structure which can be traversed via imperative language functions. At least that's how it's done in the C implementations of Prolog I've seen. Prolog also has some imperative syntax as well, for that matter.

    4. Re:Computer languages are all the same by AB3A · · Score: 5, Insightful
      Let me guess: fasteners are all the same, so let's use a hammer to pound in a screw.

      Most languages have a focus toward a particular aspect of programming. Some are very good for Object orientation. Some are good for low level hardware I/O. Some are designed to parse input in optimal fashion. Others are designed for terse code.

      They all have a purpose. That's why we have software tool chests with lots of languages and tools which can be used in so many ways.

      Forth is good for low level I/O work. It's often used in Robotics and control systems. It is a minimalist language and it generates very fast, memory efficient code. These are good traits when dealing with embedded processors. But once you try scaling it up to do more complex tasks, you discover its limitations. That's when higher level languages start to shine.

      --
      Nearly fifty percent of all graduates come from the bottom half of the class!
    5. Re:Computer languages are all the same by Anonymous Coward · · Score: 0

      For instance, what's the equivalent of Forth's CREATE/DOES> in any of those languages. You'll find that it's an entirely foreign concept to many of the languages you mention.

      What about macros?

    6. Re:Computer languages are all the same by JohnDoty · · Score: 1

      An advantage of Forth is that it is very small-- a Forth interpreter and a Forth program together are often smaller than the equivalent program in machine code. Hence its use in firmware, and other places where size is very important.

      Without Forth, Battlezone would not have been possible. ^_^

    7. Re:Computer languages are all the same by truth_revealed · · Score: 1

      If I didn't have a screwdriver, I might use a hammer to drive in a screw. Depends on the situation. But that's just me.
      I entirely agree with your point about languages having their respective strengths in certain domains. My only point is that these language features are nothing more than syntax. If the syntax of language X leads me to write far fewer lines of code for the task and it fits in with the overall goals of the project - I'll use that language.
      But I really haven't seen a new concept in computer languages in 20 years. The next advance will likely be natural language processing - when computer languages simply be human languages. Until then we're just rehashing the same old stuff.
      (However, I do admit that the Occam transputer language is pretty unique in its own right. :-)

    8. Re:Computer languages are all the same by Anonymous Coward · · Score: 0

      CREATE/DOES> feels very similar to Lisp macros. Forth and Lisp came from opposite ends of the computing world, but are startlingly similar in many ways.

      Formalized "CompSci Forth" concatenative functional language Joy is even more like Lisp.

    9. Re:Computer languages are all the same by truth_revealed · · Score: 1

      You're absolutely right about the low memory thing.
      I forgot to add "memory consumption" to the list of language considerations.

    10. Re:Computer languages are all the same by JohnsonJohnson · · Score: 2

      I see very little difference between:

      [deleted]

      Apparently you don't look very hard. There are significant differences even in the examples you have presented. First of all the LISP/Scheme code support introspection (you can determine the contents of my_function with other LISP/Scheme code) which is impossible in the C (and that won't work in C anyway) or assembler model. Secondly the issue of type safety is unaddressed especially in the assembly and C code (what are you adding integers? Reals? Complex values? Inquiring compilers want to know). Finally to paraphrase Larry Wall states a language should make the easy things easy without making the hard things impossible which is the driving impetus behind programming language creation. There are real and fundamental disagreements over what is/should be easy and what's impossible.

      Too bad there does not exist a universal computer language compiler system whereby one could code in the computer language they prefer and check the code in and the next guy could check out the code in the language they prefer.

      That desire seems to express much of the design behind the .NET CLR. In principle it should be possible to disassemble CLR code into a language other than its original implementation, however the disconnect in features (just how would you disassemble a LISP closure into C code? Or worse yet the entire Smalltalk environment?) makes this less feasible than your simplistic assumptions would indicate.

    11. Re:Computer languages are all the same by dvdeug · · Score: 2

      All computer languages rehash the same concepts:
      set/read variables
      conditional, branching and looping constructs
      call functions


      Let's see: the FORTH textbook I own didn't include anything on variables, as it considered them unnessecary. (Which, to a large extent in FORTH, they are.) Lots of Lisp ('pure' Lisp) doesn't use branching or looping constructs, using recursion for everything. APL is comparitively normal - but looping isn't well supported, instead you do everything in parallel on vectors.

    12. Re:Computer languages are all the same by mesocyclone · · Score: 2

      XMLDataNode xdnLoginRsp = new XMLDataNode("LoginRsp");
      xdnLoginRsp.addAttribute("Result", strResult);
      WebPacXMLUtils.addNotNullChild(xdnLoginRsp, "SessionID", strSessionID);
      return new XMLDataDOM(xdnLoginRsp);

      --

      The only good weather is bad weather.

    13. Re:Computer languages are all the same by mesocyclone · · Score: 2

      This comes up from time to time.

      But computer languages vary greatly.

      It just boils down to syntax and ease of typing is just nonsense...

      how about:

      declarative vs procedural

      portability

      extensibility

      testability

      formal provability

      code compactness

      interactive vs. compiled

      static vs dynamic memory models

      object orientation

      ???

      It is a lot more than syntax.

      Forth happens to be very unusual as a language. It is extremely extensible (it is trivial to redefine the meaning of "if" should you want to). It is based on a dictionary concept. It has a compiler and interpreter that together can be written in about 3 lines on an 80 column wide screen (if you don't do pretty-print formatting). It is highly portable because, like LISP, it starts with a very small set of primitives that need to be ported, and then builds itself out of them. Creating an application from it simply continues that extension process.

      When you write an application in Forth, the high levels of your application look almost like english text optimized to express your algorithm. It doesn't even have to be recognizable as "Forth." Charles Moore (http://www.colorforth.com/), who invented Forth, is a brilliant and iconoclastic guy who made a real contribution by creating a number of original language concepts.

      One thing that is very tricky in Forth is cross-compiling. Because there is no difference between compile time and execution time, cross-compiling is inherently undefined. In order to make it work, you have to play some pretty subtle and head-breaking tricks.

      --

      The only good weather is bad weather.

    14. Re:Computer languages are all the same by Control+Group · · Score: 2
      I'm trying to decide if you're trolling or not. If so, good job, 'cause I'm biting.


      If you look only at the code the machine actually executes at the CPU level, I suppose one could make an argument that all HLLs are the same, since the code they compile into looks much the same for any given task. The difference, of course, is in what tasks the language lends itself to from the programmer's point of view. People use HLLs because they abstract concepts from implementations; different languages abstract different concepts differently, making some tasks easier to accomplish - from the coder's point of view, of course. The computer doesn't care.


      Or, you can look at it another way. There's a vast universe of things a computer can do. At the one operation per instruction level, all those tasks have a probability proportional to their number of operations, given a random program. HLLs, however, group implementation tasks (moving data from memory to a register and back, adding data from one register to another, comparing the contents of two registers, etc.) into logical tasks (square roots, screen repaints, file output), where one instruction means many operations. Hence, a random program will achieve more complex tasks - the probability of any given task occuring will depend upon what sets of operations the HLL generates with one line of code verses multiple lines of code. This means different HLLs will tend to generate programs in different volumes within the total universe of possible programs. This translates into different types of programs being easier to conceive and implement in different languages.


      I mean, really: who writes device drivers in VB? Who writes word processors in assembly?

      --

      Reality has a conservative bias: it conserves mass, energy, momentum...
    15. Re:Computer languages are all the same by Anonymous Coward · · Score: 0

      Prolog is VERY different to most other programming languages I know:

      set/read variables
      This is called variable binding in Prolog, but it happens in rather different ways. For example, X = X + 1 will simply evaluate to false. It won't update the value of X. Once a variable is bound, it can't be unbound.

      conditional, branching and looping constructs
      Prolog has no conditional, branching or looping primitives. If you want those, you use recursion. Program flow is basically controlled by a depth-first search implementation, and this is where it differs radically from other languages.

      call functions
      Well, in Prolog they're called predicates and they only ever evaluate to true or false. But they kind of look like functions.

      If you weld a pattern-matching algorithm to a depth-first search algorithm and add a few wrinkles (cuts, etc) you end up with Prolog. Prolog is, in my opinion, one of the best examples of a truly different way to think about problems. I'm not sure what its popularity is like at the moment, though... Maybe other Slashdotters are better informed?

    16. Re:Computer languages are all the same by truth_revealed · · Score: 1

      Dude, lighten up. The examples did not call for introspection.

      No one said the universal computer language translator was feasible or even practical - just that it would be nice to have. I was already well aware of all the constraints you mentioned. But I guess you never dream.

      Tell you what - when I write the universal computer language translator you won't be allowed to use it. <sticking tongue out>

      Sheesh.

    17. Re:Computer languages are all the same by Anonymous Coward · · Score: 0


      XMLDataNode xdnLoginRsp = new XMLDataNode("LoginRsp");
      xdnLoginRsp.addAttribute ("Result", strResult); WebPacXMLUtils.addNotNullChild(xdnLoginRsp, "SessionID", strSessionID);
      return new XMLDataDOM(xdnLoginRsp);


      This code could be C++, C# or Java.
      Is that the point?

    18. Re:Computer languages are all the same by davidgay · · Score: 1

      Try let x = cons(1, x) in ... in a purely functional language (e.g., Haskell) and let us know how it compares to x = cons(1, x) in C (or something similar in Forth, for that matter) [syntax arbitratry, assuming an appropriate linked-list type for C] Hint: the results are not the same.

    19. Re:Computer languages are all the same by William+Tanksley · · Score: 2

      All computer languages rehash the same concepts:

      # set/read variables
      # conditional, branching and looping constructs
      # call functions


      1. Most functional languages don't include the concept of setting a variable; reading a variable is also very different from Algol-like languages. Forth isn't functional, but doesn't have much use for variables; the closest thing it provides is essentially direct memory access.

      2. Many languages truly do no more than imitate what Fortran finally discovered so many years ago -- but there are also many more which go much, much further, starting with the simple concept of recursion and stretching onward to continuations and preemption. Although anything we know now can be implemented through continuations and preemption, many languages automate some smaller and easier to work with (or optimise) subset, such as Icon, Sather, or J/K/APL. Forth has some really interesting things to contribute here, thanks to the fact that a 'continuation' in Forth is just a single pointer.

      3. Finally, you imply that all languages call functions in the same way. You probably only know language which work in the same way; but there's more out there. Consider the differences between the parameter passing styles: C is applicative, Haskell is curried, J is combinatoral and Forth is concatenative. In other words, C depends on lambda theory; Haskell depends on curried lambdas; J depends on dataflow around functions; and Forth depends on dataflow within a stack passed and returned from composed functions. Most modern languages are lambda-based, so more like C; a few are starting to become curried, since that's a very simple change which gives a lot of power and flexibility in parsing.

      So no, language can't simply be swapped without regard.

      -Billy

    20. Re:Computer languages are all the same by mesocyclone · · Score: 2

      Actually, it is java.

      And it was a mistake to post it.

      I was having trouble posting, due to DNS propagation times due to the slashdot move, and had saved my post on the clipboard. I decided to try again, pasted it and hit submit. Oops... I had snatched some Java onto the clipboard by mistake.

      Oh well, at least it wasn't my bank account number and PIN or something!

      --

      The only good weather is bad weather.

    21. Re:Computer languages are all the same by c13v3rm0nk3y · · Score: 2

      All n-complete languages will share certain similarities in how they handle discrete requirements. How the entire language is used to express solutions to problems will not be the same in all cases. This is probably what most of us respond to when we say we do or do not like a particular language for a given solution (or at all).

      A more accurate test would be writing a solution that toggles a bunch of motors on, off and changes direction and speed in any arbitrary combination. Another good test is a word processor or desktop publishing app.

      Is your solution expressed well in the language? Does it allow you to build upon previous work? Can you abstract the various small problems well enough to decompose them into small easily tested chunks?

      One of the best parts of real-world FORTH is the ability to incrementally build your app, and to build unit-testing and full test-harnesses right into an application. Once the product is shipped, these can be left in (or not, depending on how you want it) with almost no impact on overall performance.

      Note that I am not saying this cannot be done in other languages, only that FORTH makes it trivial to develop these handy tools right alongside your regular development activities.

      --
      -- clvrmnky
    22. Re:Computer languages are all the same by joto · · Score: 2
      My only point is that these language features are nothing more than syntax.

      I disagree wholeheartedly. While it's true that very many languages don't differ in anything but syntax (e.g. C, Pascal), the interesting differences are the semantic ones (e.g. C++, Prolog, Scheme, Forth, ML, Haskell, Mozart, Perl, M4, Icon). While many features superficially look the same, the meaning of two programs with similar-looking syntax or structure can be radically different. Syntax matters little beyond the initiall "sell".

      But I really haven't seen a new concept in computer languages in 20 years.

      Interesting. I find new interesting concepts in new languages every day. But I haven't been here for 20 years, and to some degree I believe what you are saying (if you are talking of major new concepts!). Few of the languages on the list above are very young. On the other hand, I guess template metaprogramming and constraint programming are both pretty new.

  38. 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

  39. Re:Religious experience to "get Forth"? by Anonymous Coward · · Score: 4, Insightful

    Once you understand how to use the CREATE/DOES> construct effectively, you have a great deal of flexibility in expressing a programming solution. Most languages allow you to add new functions; Forth allows you to extend the compiler, using whatever syntax your imagination can conjure up --- one tailored exclusively for solving the problem at hand.

    This power is often what someone refers to when they talk about "getting" it. Forth has also been criticized by some, ironically for that very strength. Why?

    At the high levels of your application, you're no longer coding in Forth, but in the language you've designed to solve the problem. Reading that code requires a newcomer to understand that new language, in much more depth than they'd need for something like a C program. When designed by a competent Forth programmer, this code can be quite readable, at least in a general sense, by anyone who understands the problem domain. But a novice Forth programmer, particularly one who thinks in terms of writing a program in Forth (rather than extending Forth to solve the problem), can create a very unreadable mess.

    With power comes responsibility (a phrase that predates Spider-Man, by the way :). Forth has no training wheels, but once learned, it is a very useful tool. "Getting it" is worth the effort.

  40. Modern Forths are compiled, not interpreted by Junks+Jerzey · · Score: 5, Interesting

    I keep seeing mentions of Forth being an interpreted language, but that's just an implementation choice. Most modern Forths, such as iForth, VFX Forth, and Forth Inc's own SwiftForth, generate machine code and do optimization to varying degrees. iForth and VFX Forth analyze stack operations and replace them with register operations where possible. Benchmarks have shown that iForth generates better floating point code than Microsoft's Visual C++ compiler (which already generates better floating point code than gcc).

    So why don't you hear about Forth much? A couple of reasons:

    1. Forth doesn't have much in the way of standard libraries, so you'll almost certainly get more bang for your time writing quickie applications in Perl or Python than Forth. Try writing a Forth program to read in a file of strings of arbitrary length and sort them, for example. This is a one liner in Perl.

    2. Forth has always been geared toward simplicity, but modern desktop environments (Linux, Windows, MacOS) are hugely complex. Forth arguably isn't the best match for such complexity. Embedded systems are different.

    3. Forth is best viewed as an interactive alternative to C or assembly language. Certainly from the interactivity alone Forth is a better choice for incrementally building a application than assembly language. This is why Forth gets a lot of use in embedded systems. But with desktop computer speeds being insanely high, it's hard to justify working on that kind of level under, say, Linux or Windows.

    (I fully expect this to be followed by "Not true!" rantings from a Forth zealot or two. But you really do have a hard time pointing to compelling applications written in Forth for modern desktop OSes. Python is a good language, so you see some amazing applications written in it (e.g. Zope), but despite all the religion surrounding Forth, you never see much to show for it on the desktop.)

    1. Re:Modern Forths are compiled, not interpreted by e4liberty · · Score: 2, Interesting

      You are absolutely right. Here is an example...

      I've written four production FORTH compilers for various machines, including m68k PPC and x86 (before that I wrote several threaded and direct interpreters). My compilers never manifest the stacks as stacks, and use state of the art (Briggs Chaiten) register allocators. You won't see these compilers because they are used as back end code generators for other languages! The advantage of FORTH is that the front end of the compiler can be retargeted to any machine with a FORTH compiler. The runtime system and library can be written (somewhat) portably in FORTH. It's an excellent technique, and I heartily recommend it.

    2. Re:Modern Forths are compiled, not interpreted by frank_adrian314159 · · Score: 2
      Try writing a Forth program to read in a file of strings of arbitrary length and sort them, for example. This is a one liner in Perl.

      Why not just use the sort command? Then it would be a no-liner.

      --
      That is all.
    3. Re:Modern Forths are compiled, not interpreted by RevAaron · · Score: 2

      You are very right. However, at least I think it's important to note that a lot of Forth implementations are interpreters. Even when being interpreted, this Forth can often be faster than compiled C! Gotta love Forth!

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    4. Re:Modern Forths are compiled, not interpreted by c13v3rm0nk3y · · Score: 2
      Why not just use the sort command? Then it would be a no-liner.
      The example may have been weak, but the point was to solve a problem programmatically. Nobody said that all one needed to do was sort some strings. More likely, these strings would need to be sorted before being massage in some other manner based on logic of some sort.
      --
      -- clvrmnky
    5. Re:Modern Forths are compiled, not interpreted by Pig+Hogger · · Score: 2
      Try writing a Forth program to read in a file of strings of arbitrary length and sort them, for example. This is a one liner in Perl.
      Why not just use the sort command? Then it would be a no-liner.
      Forth sort_command does_not_have
  41. Re:definitions of species by Bazzargh · · Score: 4, Interesting

    Er, I did.

    Back in the day (crikey was that really 8 years ago???) I wrote PSTab, a guitar tablature typesetter, in postscript. I'd been downloading tab for songs from the (defunct?) OLGA, and wanted to print some for use at home. However, ascii tab looked crap and took lots of space on the page; if you tried to shrink it to use less paper it just left blank space at the sides.

    We had an old Apple II laserwriter on the corridor, and I had written simple EPS diagramming tools for my thesis in awk (copy and paste programming)... so armed with borrowed copies of the red, green & blue books, I learned PS properly and wrote a typesetter that you could use as a header on simple input files (I'd spotted this was how the windows PS driver worked). Once I got to the stage I could wrap ascii-tab up to make *nice* output pages my itch was scratched[1].

    Best thing about it was getting an email from a guy in NZ who used it to produce camera-ready copy for a book of banjo music - there wasnt anything else out there that could handle 5-stringed instruments :) . And that the unplayable example song getting a life of its own in the GuitarTeX manual!

    -Baz

    [1] I know there are bugs. Some of these didnt show up until I saw the output on a higher quality printer. Bah.

  42. [Old Fogey Warning] I programmed in Forth once... by Jack+William+Bell · · Score: 5, Funny

    ... And I certainly remember the joke about how in Forth you "Foot in yourself shoot."

    I did my Forthing many years ago (far, far too many). The usual thing, embedded systems work, but I actually did the programming on an IBM PC (original) using a Forth boot floppy (it had its own environment/OS). Then someone else did integration with the embedded system.

    It was a truly weird language, and it made it far too easy to create 'write-once' unmaintainable code. But it was my first introduction to many concepts, including a language that was truly 'cross-platform'. And it led to a short job at Aldus because I already understood stack-based languages, so Postscript wasn't a shock to me.

    In many ways Charles Moore is a seriously twisted genious. I have always rooted for him, despite the fact I prefer to use a cleaner, more readable language. (Can we say 'Python'? I knew we could.)

    So, in the end, I cannot say I think Forth should be in everyone's toolkit. For that reason I expect this review will be of limited use to most of us. (Attn. Moderators, notice how I managed to get this post on-topic in the last sentence. Now you have to mod me down as 'flamebait' or 'boring' or something.)

    Jack William Bell

    --
    - -
    Are you an SF Fan? Are you a Tru-Fan?
  43. 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 ...
  44. url for colorForth by wkitchen · · Score: 3, Informative

    Chuck Moore's home page:

    http://www.colorforth.com

  45. 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
    1. Re:Starting Forth is a Must! by slevin · · Score: 2, Interesting

      Speaking of Wizardry, one of the authors (Greenberg, I believe) prefers Smalltalk. You can go to the Squeak mailing lists at Yahoo and read his regular postings. I think he's a lawyer now.

      sean

  46. Why Forth is not popular by javahacker · · Score: 1

    Just my thoughts on the matter, having written many thousands of lines of Forth in the 80s. The current language trends are towards strongly typed languages, with good compile time static verification. Examples of this would be Java or C++.

    Forth, like assembler, requires the programmer to manage the stack explicitly. This gives you tremendous power, especially when it comes to shooting yourself in the foot. The level of discipline needed in a multi-programmer team to generate a large project in Forth is much greater than it is with most languages.

    Example: A minor change to a word (a subroutine or compiler definition in Forth) can easily cause a stack effect error, by either consuming too many items from the stack, or too few. This probably won't break the code (crash) at the point the error was made, but generates bad parameters for all of the code that executes from that point forward, potentially causing an actual crash at a point in the code far removed from where the error is. Debugging this kind of stack problem is a real nightmare.

    Having said all that, I loved writing routines to test new hardware in Forth, because I could interactively code and test. This made me very productive in this limited case.

    As you can tell from my handle, I do mainly Java now, and feel it is a much better choice for most projects.

  47. fortune on FORTH by Mignon · · Score: 2

    FORTH IF HONK THEN

    1. Re:fortune on FORTH by c13v3rm0nk3y · · Score: 1
      : honk ( -- )
      ." Honk!" CR ;
      --
      -- clvrmnky
  48. Jupiter Ace! by DrXym · · Score: 2

    Did anyone own one of these? It was a wacky ZX81-like computer with a membrane keyboard and 4k. of memory. Instead of programming in BASIC you wrote in Forth. Needless to say it didn't catch on!

    1. Re:Jupiter Ace! by turgid · · Score: 1

      I'll be keeping my eye out for one in the 2nd hand shops...

  49. VP-Planner by Anonymous Coward · · Score: 0

    Who recalls the 1-2-3 clone VP-Planner from Paperback Software? At the time it was reputed to be the largest and most successful commercial Forth project on the PC. By a bunch of guys from B.C., if I recall correctly. Very cool and memory efficient tool with nifty features. Too bad Lotus litigated them out of existence with the look/feel case...

  50. MOD PARENT UP by Anonymous Coward · · Score: 0

    then thrust your pelvis and hoot

  51. Re:Religious experience to "get Forth"? Feh! by nick_danger · · Score: 1
    but it can never be explained in a way that speaks to my inner geek.

    Let me rise to the challenge (and probably crash badly while trying..)

    Forth rocks for embedded apps because:

    1. Forth is threaded (interpreted Forth, anyway). A given expression is not compiled into equivalent machine code, but as pointers to subexpressions involved. Of course, those subexpressions are compiled in the same manner, until we arrive at the primatives -- the bits that are implemented as actual machine code. This sort of architecture results in very compact code.
    2. Forth is extensible. As pointed out previously, you can define any sort of behavior you want in the language. You can add compile time or run time features as needed.
    3. Forth is allows for incremental development. Forth applications are built from the ground up. Low level bits (primitatives and other bits) are built and tested first, then used by increasingly more complex bits. Testing goes hand in hand with development, since the distinction between editor/compiler/interpreter is somewhat blurry.
    4. Forth is cross platform. To port the environment, all one needs to do is re-implement the primatives on the new platform. Most primatives translate into a handful of machine instructions. This makes it easy to move to small or embedded systems.

    There's probably other reasons why Forth rocks, but that's all I could think of. FWIW, Forth was my third language (right behind Basic and UCSD Pascal) on my trusty old Apple II. Byte magazine did a feature on threaded languages in (August?) 1979, and that really piqued my interest in the language. I did some pretty cool stuff with it on my old Apple, but I haven't touched it in years. But given the compact size of a Forth system, I'd say there's a stong case for considering it when building apps that require some sort of embedded scripting language.

  52. Fabulous language, but for an uncommon situation by dwheeler · · Score: 3, Insightful
    FORTH is truly a fabulous language when you need to be able to interactively develop a program, where both the programming and execution must run on a very tiny machine (e.g., 2-48K RAM and 1-10MHz), and you still need the program to run quickly. Not only can you write code quickly, and get lots of interaction, but many Forth implementations are extraordinarily small, so you can actually read _every_ line of machine/assemly code that's executed on your equipment if you need to. I remember some absolutely magical programs being written on Apple II and Atari 800 computers (32-64K RAM, 1MHz 6502 chips).

    The problem is, the situation that FORTH is great in is becoming increasingly rare. Most FORTHs still require programmers to constantly think about how to juggle the stack if they receive a number of parameters (yes, there are some extensions). FORTH has essentially no type-checking, and the combination of these two factors means that it's extremely easy to (1) make a mistake and (2) for that mistake to have nasty consequences.

    Many program language implementations generate intermediate stack-based code (think Java class files, Python, Perl, etc.); in FORTH, you're writing the stack-based code yourself, so you are essentially writing in an assembly language for a simulated stack-based system. FORTH thus has some of the similar properties as assembler: fewer development system resources are required, but it's more work for the programmer. This isn't completely true; FORTH is definitely much higher-level than the typical assembly language program, but many programs take more work to implement in FORTH than, say, Python (which is also interactive, and it executes a stack-based program, but lets people express code in a more Algol-like way and then TRANSLATES that code into a stack-based approach).

    I do think Forth is a good language to learn, because many systems are built on stack-based intermediate languages (Java, C#, Perl, Python), and being able to directly interact with a stack-based language helps to learn how they really work.

    An implementation of Forth for 6502 is freely available.

    --
    - David A. Wheeler (see my Secure Programming HOWTO)
  53. Steps by Anonymous Coward · · Score: 0

    1. Code in Forth
    2. ???
    3. Get a lot of chicks who want to have sex with you

  54. My Forth Algorithm by Anonymous Coward · · Score: 0

    I acutally used this language to implement a binary search tree. As you might have guessed, I had to traverse Back and Forth...

  55. cellular automata machine application by Raiford · · Score: 2
    Forth has never seemed to lend itself to mainstream application development. However it is found in a lot of special applications. My first introduction was in the programming of a special purpose computer for generating cellular automata. It was called the cellular automata machine (CAM) and it was a custom machine specifically designed for doing CA experiments. The simulations had to be programmed in Forth. This was way back in the late 80's/early nineties.

    Most people who were weened on HP RPN calculators like Forth's postfix notation. I find it a bit unnatural but I was a FORTRAN man for a long time.

    --
    "player 4 hit player 1 with 0 stroms"
  56. It's for embedded systems!!! by fmaxwell · · Score: 2

    But you really do have a hard time pointing to compelling applications written in Forth for modern desktop OSes. Python is a good language, so you see some amazing applications written in it (e.g. Zope), but despite all the religion surrounding Forth, you never see much to show for it on the desktop.

    As you point out, Forth is not a language for writing GUI applications. It's for things like controlling stepper motors in telescopes. It's an embedded systems language for low-level machine conrol. And for those purposes, it's superb.

    I, for one, appreciate its simplicity. The modern C/C++ implementations make my head hurt. I don't want a language where there are countless libraries with which I have to remain familiar. It's astounding to see how many C/C++ programmers believe that various Borland/Microsoft libraries are an inherent part of the language.

  57. Cheering section by Crusty+Oldman · · Score: 0

    Yay forth! Yay forth! Rah! Rah! Rah!

    Chuck Moore! Woo-hoo!
    Elizabeth Rather! Woo-hoo!
    Jeff Fox! Woo-hoo!
    C. H. Ting! Woo-hoo!
    Skip Carter! Yer doggin' it, dude!

    Best fan sites:
    http://www.forth.org.ru/
    http://www.fig-u k.org/

  58. Re:But is it better than Fifth? by Anonymous Coward · · Score: 0

    I wouldn't know old chap.

  59. Groking Forth and stuff by oldstrat · · Score: 3, Interesting

    Once apon a time the first language for any new machine was Forth. But then again it's been a long time since we've seen any really new machines.

    The reviewer is correct, someone groks forth or they don't.
    Being a person who groked it from the second he saw it in 1978, I can't understand anyone not getting it.
    Sure RPN notation is hard for some (apparently most) folks, and boolean logic just doesn't seem to be natural for most people, and then the stack just knocks them in the head, but these are three of the four pillars of what makes forth great.
    The fourth pillar of forth is that you can change it to be anything you want, most languages have to be learned, forth is a language that you can teach to learn you... If RPN is just intolerable you could redefine it and still leave the core alone for pre existing words (functions for the non forth crowd).

    Leo Brodie's "Starting Forth" and "Thinking Forth" books are great and it's a shame that Brodie no longer has an interest in the language.

    As a long time forth user I'm not thrilled with the complexity added in C. Moore's latest version colorForth, it seems to add a new layer of complexity, but then again I may just be unable to Grok it.

    Personally I'd love to see Forth brought to the GUI era and don't understand why it hasn't been.

  60. Does anybody remember Urth? by kzinti · · Score: 2

    Or maybe it was URTH, which I think stood for University of Rochester forTH. I seem to remember using this language once upon a time as a co-op back in about 1982, but the net, even Google, seems to retain little memory of it. I say "seem" to remember because I can't recall which exact FORTH or FORTH-like language we used, but I'd like to know because I'd like to find a similar version.

    --Jim

    1. Re:Does anybody remember Urth? by Anonymous Coward · · Score: 0

      How about YERK? An object-oriented version of FORTH we used at Yerkes Observatory for telescope control.. Weird but fun!

  61. yerk by Anonymous Coward · · Score: 0

    Do a search for YERK- it's an OOP implementation based on NEON, and it's sorta open source. More like, not really licensed.

    It's been updated for PowerPC, and has some pretty good documentation.

    Anyone remember the book 'Thinking Forth'?

  62. Not Forth, but Forth-ran! by Anonymous Coward · · Score: 1, Funny

    Why not use Forth-ran? It's 'Fortran' with a 'Lisp'!

  63. Pop-11 by DopeRider · · Score: 1
    If you like this sort of odd features in a language, try Pop-11, a Lisp-like language developed years ago, now open sourced.

    Used mostly for teaching AI, it has a lot of weird features. It also let programmers to manipulate the stack. The VM, called "poplog", supports multilanguage (.net invented 20 years ago) with ML + Prolog + Pop-11 + Lisp implementations off the box, and allows incremental compilation (very similar to CMUCL).

    Here you will find an online primer. Another good site.

  64. Not quite. by Nindalf · · Score: 2

    The Lisp and C styles are based on expressions to be evaluated. Their natural mode is to operate on multiple input values to produce a single output value. Workarounds, to handle multiple outputs, always feel clumsy, and generally require creating more named temporary variables. Furthermore, people naturally have a bias towards this preference, and consider it poor style to modify the machine state mid-expression (regardless of how efficient this is), preferring only to assign the result.

    The Forth style is different. Each token is an instruction to be executed in strict order, and performs its function by modifying the machine state in some way. You don't tell the machine, "I want you to find the answer to this problem," you tell it "do this, then that, next this," and in this way you get to know exactly what it's doing. "Returning" multiple values, or making multiple changes to the machine state, is easy and natural. You don't have to put in silly kludges where your return result is a proper answer in some cases and an error code in others, or resort to the absurd COMEFROM of exception handling. There is no limiting syntax to trip over, your own constructs can be as expressive as the ones that are built in.

    You don't need to understand algebra to learn Forth. As Chuck Moore says, it should be taught some time after counting and before long division.

    In short, Forth is the truly general purpose programming style. It's based on the way computers really work, not some idealized model of how we'd like computers to work. This makes some things a little harder, and makes some things much, much easier.

    That said, I don't use Forth much. Everybody uses C, or C-based tools. All the system interfaces are designed and documented for C programmers, and if you want to use them, you have to deal with the workarounds for C's shortcomings regardless of what you actually use. Since interfacing with system libraries is often the biggest and most painful part of a project, this negates the advantage of moving to Forth. Even the processors are designed for C code. Stack machines aren't any less efficient than register machines, but by the time you take advantage of a large register file, your beautifully-simple Forth compiler/interpreter is as monstrous as a C compiler.

    Compromise systems, such as ANS Forth, neatly combine the disadvantages of C with the disadvantages of Forth.

    And so, Forth ends up restricted to situations where you'd have to build up the kruft yourself if you wanted to use C. Still, I want a T-shirt that says, "I'd rather be programming in Forth!"

  65. Display Forth? by zatz · · Score: 3, Interesting

    I find it interesting that so many people comment that Forth is meant for embedded environments and has no place in a "modern" GUI system. But PostScript is similar to Forth in flavor, and its original embedded target was printers... and now OS X uses "Display PDF", more or less a superset of Display PostScript.

    Just because a tool like Forth is traditionally used by a single programmer in a very cramped system doesn't mean it couldn't have applications in other places. There are many things I wouldn't write in Forth... and there are many times I find myself writing GDI calls and wishing for a more Forth-like interface.

    --

    Java: the COBOL of the new millenium.
  66. Apple Macintosh Open Firmware uses Forth by Daniel+Joannidi · · Score: 1
    Not that forth is dead by any means, but it has sort of lapsed into obscurity. Nice to see recent development is still happening, as forth always has been the best for what its designed for, controlling stuff. Probably always will.
    Far from it - Apple Power Macintosh computers use Forth in the Open Firmware.
    In fact - any modifications to the Open Firmware variables will require a minimal understanding of Forth.
    Some reference documents:
    Apple Tech Note TN1061 - Fundamentals of Open Firmware: Part 1
    Apple Tech Note TN1062 - Fundamentals of Open Firmware: Part 2
    NetBSD MacPPC FAQ:What is Open Firmware?
  67. Re:[Old Fogey Warning] I programmed in Forth once. by Dr.+Smeegee · · Score: 1

    I humbly await your "PyForth" module. :-)

    I am doing a project now with an old-school forth guy. Reading the Forth code is a blast- I learned python as my first language and Forth has immediately put me back on training wheels!

    One odd thing about this project: it seems that a couple of us are former english majors. I can see Python appealing to a poet who likes villenelles and cestinas... I guess Forth is more like blank verse written by Spider Robinson on a punning tear.

  68. 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

    1. Re:Forth used in financial market reporting by gwadej · · Score: 1

      Some of it is still running on Forth. Other parts are on other platforms. In general, the fast but not pretty parts are still served by Forth.

  69. Re:Religious experience to "get Forth"? Feh! by Anonymous Coward · · Score: 0

    I remember that artical in Byte. I never did get Forth for my Apple II. I'm glad I'm not the only one reading /. that remembers thous days!

  70. The Forth bumper sticker by curtisg · · Score: 1

    I can't believe no one has mentioned the Forth bumper sticker:

    FORTH YOU LOVE IF HONK THEN

    --Curtis

    1. Re:The Forth bumper sticker by Anonymous Coward · · Score: 0

      \ REPLY from a couple of us FedEx FORTH programmers
      \ NDH & MAF

      : REPLY ( -- ) BEGIN +HORN 100 uSDELAY
      -HORN 100 uSDELAY FALSE UNTIL ;

    2. Re:The Forth bumper sticker by c13v3rm0nk3y · · Score: 2

      Someone did :)

      --
      -- clvrmnky
  71. Re:[Old Fogey Warning] I programmed in Forth once. by Geezer · · Score: 1

    I programmed in Forth for an embedded system used on a factory production line to detect crooked labels of bottle of liquid detergent. Ever since then I've thought of it as write-only language. Looking at the source code 6 months after the project end, I felt as if I were reading Greek. Even when writing Forth, I always kept a stack diagram next to each page of source so I could visualize the stack. Never again.

  72. GraFORTH! by byronne · · Score: 1

    I remember playing around with and really digging a variation of Forth that I think Paul Lutus(?) wrote called GraForth for the Apple ][ - it was pretty damned powerful. You could create and manipulate 3D objects really simply and do things in hires that were near impossible any other way. Built-in math functions, all the standard conditionals, etc. I remember writing a rather crude flight simulator in it that required very little graphical nuts and bolts type of coding. Wish I knew what happened to that. It was around the time that Logo was being pushed pretty hard, but Forth, syntax-wise, kicked its butt. Maybe it's time to look at it again, reverse notation and all...

    --
    "Look, Smithers! I'm Davy Crockett!"
  73. Apples Open Firmware.... by Roskolnikov · · Score: 1

    Anyone using the linux/ppc openfirmware bootloader is using a nice little forth program, makes dual or more booting a piece of cake. A while back someone turned an openfirmware equipped Mac into a pong machine.

    http://members.aol.com/plforth/ofpong

    I've added this to my openfirmware boot target and can boot right into pong :)

    --
    Unix, an obscure operating system developed by bored researchers in an attempt to get a better game playing experience.
  74. Re:Religious experience to "get Forth"? Feh! by Anonymous Coward · · Score: 0

    The thing about FORTH is that it teaches you to think differently. It shares some properties with assembler; no type casting for a start. You don't actually write programmes in FORTH, you modify the language to suit your needs. It also tends to have some nifty properties like co-operative multi-tasking and really easy ways to integrate assmebler. after all they're both stack based.

    I wrote the software for my Bachelor's project in FORTH, a control system for the lifts in my department. The thing ran four separate threads to do create the traffic (from a file), control the lifts and display the current status. It was only a few hundred lines of code.

  75. Re:[Old Fogey Warning] I programmed in Forth once. by ch-chuck · · Score: 1

    You're not alone - I got a FORTH like system going on an Altair 8800 once, working from a Byte book "Threaded Interpretive Languages", and used it to program a TMS9918 graphics chip (what TI99/4s used for graphics) wire wrapped on an S100 board and eventually worked up a little 'dungeon explorer' game with it, where a sprite moves around a 3x3 screen 'dungeon' w/ 3 levels (27 screens total). The video out went into an old color tv (direct! no rf modulator). Anyway, even on a 2Mhz 8080 FORTH was fast enough to flip screens into the 9918 with little noticible delay. One other project was rewriting the BASIC game 'Othello' in FORTH so it would play faster ;))

    But that was 1983 and it was time to shelve the Altair and get an Atari.

    --
    try { do() || do_not(); } catch (JediException err) { yoda(err); }
  76. Two best things about FORTH by tgibson · · Score: 1

    The first is that you can define compile-time behavior (in the forth sense of compiling)--very cool. For example, you can create your own application-specific branching structures. You're not "limited" to if/then/else for example. Just roll your own quaternary branching statement if that's what you need!

    The other is being able to (forced to?) build your own data types from scratch. I actually learned FORTH before I learned C. I was all bent out of shape when I found out that C automatically handled pointer and array offsets for me (e.g. *(x+3) actually means x+3*4 where 4 is the number of bytes for each x). I recall that at the time I felt C took me so far away from the machine whereas I was much closer to it in FORTH.

  77. A Forth-related anecdote by frozenray · · Score: 2, Interesting

    I remember a story I read in the famous German "c't" magazine many years ago:

    Sometime in the 80s (Germany was still a divided country then), a competition was held for university students from all over Germany. The goal was to write a program to control a robot to perform some predefined tasks, with the team who took the shortest time to finish the program being the winner.

    The teams from West Germany used their butt-kickin' (for the time) Intel-based systems (DOS, C, Pascal, harddisks and whatnot).

    The competition, however, was won by the only team from East Germany. They used an U880 (a GDR Z80-clone running at 1 or 2 MHz) based Robotron computer which had maybe a tenth of the power of the other teams' computers, and Forth as a programming language.

    Yep, it's not the size, it's how you use it ;-)

    --
    "There are already a million monkeys on a million typewriters, and Usenet is NOTHING like Shakespeare." - Blair Houghton
  78. Re:[Old Fogey Warning] I programmed in Forth once. by Angst+Badger · · Score: 2

    In many ways Charles Moore is a seriously twisted genius. I have always rooted for him, despite the fact I prefer to use a cleaner, more readable language.

    Amen to that. A lot of Chuck's work, especially his new ColorForth, borders on the bizarre, but it's never drooling-in-the-corner bizarre -- it's always mad genius bizarre.

    That being said, Forth is a lot of fun to work with even if you never do anything remotely useful with it. The underlying dynamics of a Forth environment are simple enough that you can roll your own very quickly, which is not something you're going to do with C or C++ or Java. Ultimately, that's what probably kept Forth from becoming more popular: the temptation to create new Forth-like languages was easily satisfied by Forth programmers. Case in point, of course, is Chuck Moore himself, who apparently despises the standard version of Forth and who has never stuck with one version of the language for very long.

    Using Forth and building your own Forth environment is still a fascinating way to gain insight into interpreters and virtual machines, and the kind of thinking required for using Forth well is quite an enjoyable exercise. If you do want to use Forth for "real" work, it is worth bearing in mind that some very complex systems have been built very, very quickly by seasoned Forth programmers -- including air traffic control systems -- and the mode of bottom-up programming used in Forth basically ensures continuous unit testing, so Forth programs tend to require less debugging late in the development process.

    --
    Proud member of the Weirdo-American community.
  79. why use Forth when Python is available by Anonymous Coward · · Score: 0

    what so special about Forth that Python can't do?

  80. Re:Religious experience to "get Forth"? by foote · · Score: 1

    "At the high levels of your application, you're no longer coding in Forth, but in the language you've designed to solve the problem."

    That sounds similar to what Paul Graham says Lisp allows you to do. Is it, or do I not understand what you're describing?. (I've never looked at Forth, so the latter is likely.)

  81. Quick summary of Forth by Anonymous Coward · · Score: 0

    1. Lower-level than C, yet slower in most real-world tests.

    2. Significantly harder to maintain large codebases than Java, or C++.

    3. Not as potent as Lisp.

    4. Small compilation, interpretation, and execution.

    Why do Sun, FedEx, and NRAO use Forth? My money is on: because they haven't switched to another language yet.

  82. My learning curve by satanami69 · · Score: 2

    So, uh, does anyone have a Fourth "Hello World" program yet?

    Preferably one that has email built into it.

    --
    I really hate Dan Patrick.
    1. Re:My learning curve by c13v3rm0nk3y · · Score: 2
      : Hello ( -- )
      ." Hello, World!" CR ;

      There is a text editor that allows you to write the macros in FORTH (as per Emacs/LISP). I don't recall the name or details.

      Integrating such a beastie would be trivial in Mutt or Elm.

      --
      -- clvrmnky
    2. Re:My learning curve by Torg · · Score: 1

      : HELLO ."Hello World " ;

  83. (Fond) Memories of Forth by Dartagnon · · Score: 1

    Hi guys (and gals),

    Reading this collection of comments about Forth certainly brings back
    warm and nostalgic memories. My name is Henry Laxen, and back in
    1983, my friend Mike Perry and I implemented the Forth-83 standard on
    a bunch of different machines, including the 6800, 8086, 8080 and I
    don't remember what else.

    While it is easy to be derisive about Forth, believe me when I say
    that there is a lot you can learn about programming, language
    implementationand and especially "factoring" if you take the time to
    study the language.

    One thing Forth teaches you discipline. Back then, all we had was a
    64K (not 64M) address space, and yet we managed to develop some pretty
    impressive applications. I worked on the Panasonic HHC (the world first
    hand held computer) which used Forth as its operating system and
    application language. Inside of a 16K rom we managed to fit not only
    the Forth language and operating system, but a memory based file
    system, a calculator, a "memo pad" which allowed you to store
    messages, an alarm clock/schedular, and the ability to add "capsules"
    to extend the system. All this ran on a 6502 processsor.

    Another great thing about Forth is that a single mind can read and
    understand the entire Forth system, from low level inner loop to the
    "meta-compiler" that allows Forth to compile Forth. Unlike C, PERL,
    (which is my current favorite language), LISP, or God forbid C++, I
    don't think there is any single human who can comprehend at the bit
    and byte level how the whole thing works. With Forth you get the
    whole language and operating system in less than, say 50 pages of
    source code. Even a feeble mind such as mine can grasp the whole
    thing. Those of you out there who are planning on making software
    your vocation will learn many valuable lessons by putting some effort
    into understand how and why Forth works, even if you never use it in
    an application.

    Another area where Forth "shines" is in debugging hardware. It
    compiled/interpreted nature make it both very fast and very easy to
    write simple little hardware probes, that even a hardware engineer can
    be cajoled into understanding. I remember our hardware guys
    marvelling at the "bright traces" they could get on the scopes after
    writing one line of Forth code to probe a particular memory address or
    io port.

    Let me relate to you a few of the "sayings" we used to use back when I
    was involved in the Forth world.

    1. Inside every large program there is a small program crying to get
    out.
    2. In any piece of code larger than 1K, it is always possible to save
    1 byte.
    3. Never waste a cycle!

    This was the nature of Forth, doing more with less. In these days of
    gigabyte RAM and multi-gigabyte disk, it seems kinda silly, but the
    nevertheless, the close interaction with the machine, and the
    understanding gained as to what is really going on when you write a
    program made learning Forth invaluable.

    One last comment. Many people complain that Forth is a write-only
    language, and that once the code is written no one else can understand
    it. While this can be true if the programmer is lousy, just the
    opposite can be true if the programmer is good. I invite any who
    are interested to inspect the source code for the Forth-83
    implementations that Mike and I put together, and I'm sure you will
    find that with the proper factoring, and the proper choice of names,
    your can be more readable than lot's of C, LISP, .. etc., code that is
    out there.

    Well, thanks for indulging me in this trip through languages of days
    past. I will always be grateful for the lessons I've learned by using
    Forth, even though I find that for web work, PERL is an easier choice
    these day.
    Best wishes,
    Henry Laxen

    1. Re:(Fond) Memories of Forth by Anonymous Coward · · Score: 0

      I've always wondered what happened to you two. F83's source is still (IMNHO) an amazing piece of work. I spent some time screwing around with the 8080 version; got far enough to add all of the Z80 extensions. Though I don't use it anymore, the 8086 version gets copied to the hard drive of each new computer I buy (sort of a good luck charm).

      I always liked the little bit from Hamlet at the end of the source code ("The rest is silence").

    2. Re:(Fond) Memories of Forth by Dartagnon · · Score: 1

      Thanks for the nice note. Mike Perry is working for Firmworks these days, and I'm "retired" and living in Mexico in the winters and Reno in the summers. For more info see: http://www.maztravel.com
      Best wishes,
      Henry Laxen

  84. Nothing else comes close by Anonymous Coward · · Score: 0

    I've seen some amazing things in forth. Entire production lines running on 8085 chips. Space invaders written in half an A4 page.

    Nothing will every be able to do that again.

  85. Forth books by KarenAnne11 · · Score: 1

    I'm about to make a major move and the Forth books ("Starting Forth","Thinking in Forth", "Threaded Languages" and 2 or 3 Forth Inc manuals were slated for the trash (ie a library book sale that will prolly do the honors). If someone throws shipping money (or wants to pick up in Tampa) in my direction, they are welcome to them. Let me know by 10AM 10/1 cuz they are goin',goin'......I think my email addr is in my bio somewhere.

    1. Re:Forth books by Anonymous Coward · · Score: 0

      Karenann11,

      I am very interested in the Forth books. I have searched for some of these titles over the past year or so without any success. Please contact me at tranchemontaigne@hotmail.com and I will give you whatever information you need to get these books to me.

      I look forward to hearing from you.

      C. Taylor
      tranchemontaigne@hotmail.com

    2. Re:Forth books by joem4539 · · Score: 1

      Don't throw them. I do forth and want to create my own. How about a $50 cahsier check for all of them?

  86. MOPS like if honk then by cosmo7 · · Score: 2

    ah, MOPS was beautiful. a few bugs here and there, but any language that is free and comes with all of its source - so that you spend hours trying to work out just how it does something - is a joy.

  87. ne1 remember JForth? by Rock · · Score: 1

    JForth was a professional FORTH implementation for the Amiga. It was very fast, and offered advanced features such as structures and GUI support. This FORTH was not traditionally threaded -- the "J" stood for "jump", and used 680x0 jump linkage between words. This gave it a lot of speed, at a tradeoff of making programs a bit larger than a "real" FORTH would.

    My first Open Source program was written with JForth. I called it IconJ. Its purpose was to allow the icon associated with a program to store various initialization values, and even scripts. In modern terms, it added a bit of object orientation to the file system. (I didn't think about it that way while writing IconJ, though. :)

    --
    - - -
    "The sixth sick shiek's sixth sheep's sick."
  88. Forth-like natural language, still spoken today by iskander · · Score: 2, Interesting

    Euskera, the native language of the Basque people, has a basic structure that is reminiscent of Forth. Whereas English speakers are used to a caseless prepostional system, Euskera speakers are used to a case-based postpositional system that leans mostly toward a "reverse" sequence of sintagms. Here are some examples in my (now rusty) dialect:[1]

    • Gizona naz - I am a man - Gizon(man)+a(a, the) naz(I am)
    • Zergaitik etorri zara? - Why have you come? - Zer(what)+gai(cause)+tik(for, via) etorri(come) zara(you are)
    • Etorri dirala dino - He says that they have come - Etorri(come) dira(they are)+la(that) dino(he says)
    • Datorren barikuan berriro etorri gara - We will come again next Friday - Dator(it comes)+en(that) bariku(Friday)+an(on) berri(new)+ro(each, for each) etorri(come)+ko(normally local genitive case marker, functioning here as a future tense marker) gara(we are)
    • Ikusi dozun gizona etorri dala dino - He says that the man whom you saw has come - Ikusi(see) dozu(you have)+n(that) gizon(man)+a(a, the) etorri(come) da(he is)+la(that) dino(he says)

    Well, I could go on, but I think you get the point.

    You can think of a case postposition (of which there are quite a few and which confer great functional specificity) as a sort of type marker, which makes Euskera a sort of object-oriented, reverse-notation language.[2]

    __

    [1] Any euskera batua fascists reading this can send their corrections of my grammar and spelling to /dev/null.

    [2] Well, reverse for English speakers in any case, ha ha.

  89. Janitor versus web designer by Anonymous Coward · · Score: 0

    If you still have either in this environment, you're wasting money.

    If you have a janitor, you're too proud to spend 10 minutes emptying a couple of wastebaskets, taking the stairs down to the trash bin, and running the vacuum over the floors every 2 days.

    If you have to hire a web designer, you probably don't have the mentality to run a decent web based business anyways.

    Aren't these sort of businesses already gone?

  90. OT: OLGA by scm · · Score: 1

    OLGA is still around. Of course, all the tab files are far from US soil (IIRC, the mirrors are in Poland, The Netherlands, and one other)

  91. zForth - Open Source Forth Interpreter by GeneOff · · Score: 1

    zForth is an open source Forth interpreter written by Bill Zimmerly. He hosts the Forth web ring at zforth.com. This site uses the zHTTP server, a web server written entirely in zForth.

    This is a list of Forth related stuff in the webring:
    http://www.webring.org/hub?ring=forth&li st&pag e=0

  92. yaof (Yet Another Old Fart) by Erebus · · Score: 1

    Back in the early 80s, there wasn't much to code on at home for us old geeks. I had an Atari 400, and it was either cartridge BASIC, or FORTH. It was a godsend; primitives (atoms) were written in 6502, you could write your own words in assembler, you could build a foundation, and get as high-level as you wanted, all in one compact, concise, efficient language. God, I miss those days. Of course, I don't miss having to upgrade my 48K of memory to 64K, but it was still fun.

  93. Re:Forth books-shipping. by Anonymous Coward · · Score: 0

    "I think my email addr is in my bio somewhere"

    I didn't see any. How much for third class shipping?

  94. Re:Religious experience to "get Forth"? by joto · · Score: 2

    Paradoxically enough, that is true. While Forth is a completely unsafe, ridiculously simple to implement, machine near-language, Common Lisp is a big and complex language, trying to abstract away from the underlying machine as much as possible. Yet, they share this unique strength together, although in very different ways.

  95. Useed forth 18 years ago by 00_NOP · · Score: 2

    It was fun. But RPN is not a way to run a whelk stall.

  96. Free (free speech) Interpreter by Newtonian_p · · Score: 1

    There is a GPL'd Forth interpreter out there: GForth

    It is the Forth implementation of the GNU project and is available for many platforms including Linux, Windows and OS/2.

    --

    There are 2 kinds of people in this world: Those who write in decimal and those who don't

  97. Forth: The Hardware Person's C by occamboy · · Score: 1

    I used Forth in the early 80s to build computer-based test equipment. It was super awesome for that purpose. (The stubborn avoidance of floating-point numbers was an irritant, but kept one on one's toes).

    It always seemed to me that Forth and C were two solutions to the same problem: the need for a lightweight and portable computer language. Something very close to macro assembler, but with cross-CPU portability. Back in the "good old days", we didn't have CPU cycles or memory to spare -- to paraphrase Dr. Dobb's motto back then, we needed to run light without overbyte.

    Forth seemed to attract the hardware types, like me. C attracted the software types. The world became overrun and dominated by software types, so we know who won.

    As fondly as I remember Forth, I can't imagine that Forth would have much use these days -- modern languages are just so much more powerful.

    Perhaps Forth would be useful for really terrifyingly critical embedded systems, say, for weapons or medical use. It seems to me that since Forth is so close to the hardware level, it lacks the inherent untestability and instabilities that occur in modern languages with their many levels of abstraction.

  98. Re:Ya' know, there's one well-known Forth codebase by andfarm · · Score: 1

    FBMuck is available at http://www.belfry.com/fuzzball/. I've messed around with it a bit: workable, but most of the code is still in C. What I'd really be interested in would be a MUCK written entirely in Forth (except, perhaps, for the socket code).

    --

    TANSTAAFI: There Ain't No Such Thing As A Free iPod.

  99. going back 18 years ago by Anonymous Coward · · Score: 0

    I had a program in Fourth that would calculate pi to any decimal place you wished.

    Converted to basic for the PET. I think i still have the printout somewhere......

  100. not really by g4dget · · Score: 2

    Forth and Postscript share that both use RPN (reverse polish notation), and as a consequence have some similarities for stack manipulation. So do HP calculators and the Java virtual machine. Beyond that, however, the languages couldn't be more different. Forth is a low-level language with no runtime safety and no dynamic typing. Postscript is a dynamically typed language with garbage collection. Except for the use of RPN notation, Postscript is really closer to languages like Lisp.

  101. when it needs to be small and interactive by g4dget · · Score: 2
    Forth is great when you need an interactive language and have very limited amounts of memory available. Something like a boot ROM or a tiny embedded system. You can squeeze a full, interactive system into a couple of kilobytes.

    But that is probably its main virtue. Once you move development "off board" and use a batch compiler, you might as well use a compiler (C, Modula-2, etc.).

  102. Starting Forth for Sale by Anonymous Coward · · Score: 0

    Hi,

    I have a cheap (but card-cover bound) copy of starting forth, which I wanna sell.

    If you wanna buy it, I am selling it for $36 dollars, and free shipping is included for within
    the USA (USPS.)

    However, I will be willing to exchange it with any *old* book on Lisp (mail me first, to see if I have it.)

    mail me at "jazzy_merchant yahoo at dot com"

  103. May the Forth be with you... by Anonymous Coward · · Score: 0

    After comprehending the force that sequencial pharsers together keeps, in reverse polish notation think you will!

    -- Yoda in a cs class for young jedis

  104. Ah! The memories... by Pig+Hogger · · Score: 2
    15-16 years ago, I had a job with Forth. We were developping applications for the Panasonic RL-H1400 Hand-Held Computer.

    I wrote a decompiler that produced compilable Forth code from competitor's ROMs (and we had loads of laughs looking at their inept examples of programming, such as "1 = if 1 else 0 endif" which basically did nothing at all), and I also managed to squeeze in a 4K bytes ROM an insurance rate table with 10,000 integer entries (the second derivative did fit in three bits or something silly like that).

  105. Forth application in 3D animation by Comrade+Pikachu · · Score: 2

    Forth is used as the backend scripting language for the 3D animation software Realsoft 3D. Realsoft also also happens to be my favorite dark horse candidate in the highly competitive 3D animation marketplace, notable because it runs on Linux.

    When you think about it, a low level language like Forth is ideal for such an application. Realsoft strives for realtime OpenGL animation playback, with physically correct simulation, particles, deformation hierarchies and tons of geometry thrown at the screen. Forth is fast enough to solve custom animation expressions without getting in the way.

  106. citing FedEx???? by salmo · · Score: 2

    I'm sorry but I have a lot of trouble with FedEx being cited as the second "credible" company on this list. I know for a fact that FedEx's call centers are running programs written in FoxPro on DOS. Does that make FoxPro a great language? Even the author of the program (who wrote it in college in his free time while working there) would wouldn't agree to that, despite the fact that they're still paying him to support an app that they refuse to pay the money necessary to replace.

    I also know that FedEx still has huge monolithic apps written in COBOL on IBM mainframes, since I get nice descriptions of them from my professor on Monday and Wednesday nights (he works there during the day). COBOL, people, COBOL.

    I'll make a blanket statement as a Memphian who knows entirely too many people who are either employed by the company or serve as vendors to it: FedEx is a big slow giant that made a lot of decisions in a hurry that it doesn't want to pay to take back. For example, they just built a nice new world headquarters that consists of some of the most modern buildings in this part of the country (ok, not saying a _whole_ lot, but still) and what do they furnish them with? Yup, the furniture they bought in the '70s and '80s.

    So when someone says "FedEx uses ____" I tend to ignore that fact and move on. Not every decision they've made is bad, but very few have anything to do with the technical merits of the choices given.

  107. Have you used COBOL? by jotaeleemeese · · Score: 1

    Or are talking based on your obvious prejudices?

    COBOL is an excellent languages for many busineess oriented tasks and the cost of a replacement with something else (why, because it is "modern") may very well outweight any benefits.

    --
    IANAL but write like a drunk one.
    1. Re:Have you used COBOL? by salmo · · Score: 2

      For these situations its more of an issue of scalability. COBOL scales well on a single machine. But when you're running the biggest box IBM makes and you're barely able to keep up (IE, you have 24 hours to work in and you're using all of them) you're running into problems. Also the fact that it wasn't designed in an object oriented manner causes issues, because when they change any piece of code they have to retest the entire program.

      Have you worked in the software industry or are you just talking out of a random orifice? I won't argue with COBOL as a language (I've used worse), but more as an environment for solving large scale business problems.

      My argument was not against COBOL, but FedEx for using antiquated practices that risk not solving their problems reliably to save a few bucks here or there in the short term, ignoring the long term repercussions of their actions.

      For example, if they had bit the bullet and bought new furniture 5-10 years ago, they would have saved money. They are paying a lot more to refurbish their old furniture than they would invested in new furniture that would not require work today. I know this because I used to do tech support at the company that sold and refurbished the furniture.

      Or take my friend's application. FedEx put out a bid for new software. My friend and other companies put their proposals out on the table. Sure, some of the solutions were terrible (required private hard networks across the country, etc.) I saw well designed, light weight, easy to manage proposals. Would have required an initial investment, but would have saved a fortune in support costs over the long term. But because of political issues, etc. they stuck with what they had. Then again, I'm happy about that one because my friend can sit happy for the next few years, despite any economic problems elsewhere in the industry.

  108. Starting Forth & Thinking Forth by NickFitz · · Score: 1

    Leo Brodie mentions that Thinking Forth is back in print, and he may be revising Starting Forth.

    --
    Using HTML in email is like putting sound effects on your phone calls. Just say <strong>no</strong>.
  109. URL for zForth - Open Source Forth Interpreter by GeneOff · · Score: 1

    I asked BillZ for the URL, here it is:
    http://www.zimmerly.com/wbz/zforth.tar.gz

  110. Ever heard of "machine language" or "assembler"? by Anonymous Coward · · Score: 0

    Just MOV it! There you have total control over your system... with thousands of MIPS and gigabytes of memory (or whatever you call a decent PC today).

  111. Forth and the Mac by theolein · · Score: 2

    For those of you here who own a Mac and want to experiment with a little bit of Forth, there's a built in Forth interpreter in the Mac Chipset (also on some SUN machines). OpenFirmware, the Mac Firmware engine, uses forth and you can do some command line dicking with the stacks etc by pressing Command-Option-O-F at boot, which will take you into the Forth commandline environment.

    Have fun and be careful because you can seriously damage your Mac with some careless forth scripts.