Newsgroups: comp.realtime,comp.robotics
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.kei.com!sol.ctr.columbia.edu!howland.reston.ans.net!pipex!uunet!world!decwrl!netcomsv!netcom.com!jfox
From: jfox@netcom.com (Jeff Fox)
Subject: Re: Forth (was Re: Real-time systems:  Windows-NT or QNX)
Message-ID: <jfoxCy44wA.Jv1@netcom.com>
Sender: jfox@netcom.com (Jeff Fox)
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <38b4u5$isa@ixnews1.ix.netcom.com>
Date: Sun, 23 Oct 1994 06:33:45 GMT
Lines: 81
Xref: glinda.oz.cs.cmu.edu comp.realtime:7313 comp.robotics:14657

In article <38b4u5$isa@ixnews1.ix.netcom.com>
            kmgibbs@ix.netcom.com (Kent Gibbs) writes:

>	Forgive me for my ignorance as I'm not that familiar with
>Forth, but it does seem to solve some problems in that you are able
>to build the dictionary to suit the application.  Is this correct?
>I don't know if it will handle critical interrupts or not but it does
>seem to be fast and robust. I guess I don't understand the bad
>reputation.

Everyone will agree Forth is extensible, that is a programmer extends
the language by adding the application to the language.  It supports
interactive development with a fast turn around development cycle
and incremental debugging in small steps.

Now most modern integrated development environments allow a programmer
to edit/compile/debug as quickly and easily as possible to improve
programmer productivity, but Forth has provided this type of integrated
environment for more than twenty years.  Subsecond compiles are nice.

Forth is different things to different people, and there are countless
implementations of Forth on different computers.  It is hard to say too
much that would apply to every Forth!

Forth can compile to threaded code that needs an inner interpretter, and
runs an order of magnitude slower than code compiled with an optimizing
"C" compiler.  But this is true of most interpretted languages, in fact
as interpretted languages go Forth can be very fast.  But Forth can
also compile to optimized machine code in many implementations.  It 
can compile to native code that will be faster than native code 
compiled by "C" in some cases.

Interrupt handling is very implementation and processor dependent.
Many Forths do provide a simple cooperative multitasking.  Even high
level threaded code implementations of multitaskers in Forth tend
to be pretty fast.  (I have timed a couple PD Forth multitaskers on
my 486, and they were doing 30,000 - 60,000 task switches /sec.)

Some Forths have no interrupt support,  others have sub-microsecond
task switch times.  Alot also depends on the processor you choose.

This brings me to the point that the Forth language can be implemented
in silicon directly.  That is the primitive instructions in the Forth
language can be the machine code of a computer.  This makes it very
fast and very easy to program and very small and potentially cheap.

The language is so simple that you can fit a Forth compiler into
the ROM of a chip like New Micro's 68HC11 with Forth on ROM.  For
small projects Forth can be small, and it can make the most of
the resources you have.

Forth blurs the distinctions between language and application, and between
hardware and software.  For all of these reasons and others Forth
makes it possible for people to get things done.  

You will hear many strange things about Forth, such as that there
are people who love it.  But Forth has a bad reputation and many
people dismiss it for many reasons.

The inventor of Forth, Charles Moore, gave a talk today for the
Silicon Valley Chapter of the Forth Interest Group.  He talked about
the chips that he is designing on his 7 kilobyte VLSI CAD system
that he wrote in Forth.  Some of the numbers sounded like science
fiction to me, and I have been working with him for several years.

Of course since I am paying for the  F21 development it sounds like
a great chip for robotics to me.  But I also think that the 100mip
8 bit chip that may retail for $.10 might be nice for robotics.
Forth makes these chips possible, Forth makes it possible to develop
these chips cheaply. 

But one of the problems with Forth is that it is easier to dismiss
than accept ideas that require you to change the way you think.  And
Forth is very different than other programming languages.

Jeff Fox
Ultra Technology -  I hope this post did not leave anyone with a bad
                    taste.  There was no humor intended, just the facts
                    as honestly as I can report them.

                     
