| I haven't used FORTH in a while, but am constantly using my HP
15C and HP35 calculators, both of which operate very in a FORTH manner.
FORTH and RPN calculators really DO make sense... You give the machine
the numbers, then tell it what to do with them. This is also called post
fix notation, as opposed to the in fix notation we're more familiar with.
Consider a typical calculator's keystrokes...
2 first argument
+ I can't add anything yet!
3 second argument
= ok, I remember, he wanted to add!
On an HP (or FORTH), this would be something like
2 first argument, put on stack
3 second argument, put on stack
+ Replace two arguments on stack with one result
of sum, display
Also, most calculators that use algebraic notation often use a
mix of RPN and algebraic when they have single argument functions:
2 function argument
sqrt do the square root of it
This mix of in-fix and post-fix on algebraic calculators can make
it fun figuring out which to use when (along with hitting the equals key
a half dozen times). With RPN, the calculation proceeds the way you
would do it by hand (from the inner most parentheses on out).
FORTH is an interesting language, though it tends to be write
only (no one else can read it). I've seen some neat algorithms that
convert algebraic expressions to FORTH, which can then be easily
evaluated by a stack oriented machine.
Finally, years and years ago I licensed a 6800 Basic interpreter
from Microsoft. It's interesting to see how it evaluates an expression.
It actually scans the line left to right, interpreting as it goes along.
When it sees some sort of two argument operator (like + ), it goes on and
evaluates the second argument, which may involve recursive function
calls. It's pretty neat. When it finds a function call, it calls the
function evaluator, which then looks at the argument and calls the
function evaluator again to evaluate the argument to the function. This
continues until there is actually some number that is returned, then all
the functions return.
So... so much for Forth, RPN, and algebra!
Hallikainen & Friends, Inc.
See the FCC Rules at http://hallikainen.com/FccRules and comments filed
in LPFM proceeding at http://hallikainen.com/lpfm
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
or call Juno at (800) 654-JUNO [654-5866]
Scott A. Woods
Darrel Johansen wrote:
> FWIW, I know that Forth is still used in a number of embedded systems
> by a small (and diminishing) community. I've always thought that if
> you can get over the learning curve, Forth offers things that other
> development systems (it's more than just a compiler) only aspire to:
Diminishing? I wonder. Maybe (more than maybe!) it's a bit like
saying that Linux is dying out.
I have a couple of theories. While more and more people have access
to (affordable) computers, and many fiddle with VB and such, I don't
think that many more are actually *programming*, which in terms of
Windoze APIs and such is getting more and more complex (which is *why*
VB and VC exist of course).
There is a *fair* expansion in what we call "embedded" programming,
which seems to be simply applications of small micros as against big
ones. The old literature has died, or become moribund (Byte and Dr.
Dobbs), some is thrashing (MCJ) and only Circuit Cellar Inc. seems to be
thriving (accordingly, I must go subscribe - I really should have done
so the moment MCJ went critical). This must suggest something.
I propose that the FORTH community is in fact expanding, it's just a
rather specialist group interested in efficiency, style and real-time
operations in a certain area. Funnily enough, a lot of it is still in
the traditional home area of robotics, astronomy and process control.
You no more use FORTH to program a PIC toaster than you do Java, "C++"
or VB (;-) and PICs are really *not* made for native FORTH at all, so it
is not surprising that it features little on this list. You can use a
FORTH system to cross-compile though, just like PICBASIC.
Up the spectrum a bit though, if you have a robot on which you wish to
cut-and-try routines, iteratively reprogram and step through motions
manually, you still use FORTH!
There is a forth compiler for the Pic 16C84 and it works very well.
If you havn't located it , it's at
Have fun :-)
More... (looser matching)
- Last day of these posts
- In 1998
, 1999 only
- New search...