Version 34 of Forth

Updated 2007-07-17 20:13:15 by AK

Forth is a computer programming language based on Reverse Polish Notation (RPN), e.g. in arithmetics like HP calculators:

 1 2 + 3 * 4 /  ( comments start with open paren and extend to close paren)

compares to Tcl's

 [expr {(1+2)*3)/4}] ;# comments

or, using Math Operators as Commands,

 [/ [* [+ 1 2] 3] 4]

http://www.forth.org/

FORTH in tcl anyone?

Chuck Moore created FORTH in 1970. An interesting article about FORTH appeared in Byte magazine [L1 ] .

Related to this is 1% the code a shocking paper by Chuck Moore.

Tutorials

  • Brief Introduction [L2 ]
  • And so Forth (a primer)[L3 ]
  • Comprehensive (for 4tH)[L4 ]

Leo Brodie's "Starting Forth" as a starkit for Windows/Linux/Solaris can be found here [L5 ], based on the web version of the book at [L6 ].

AK This starkit seems to need a package 'scripdoc', which is not in the starkit.


Often over the years, FORTH and Tcl have been compared because of the mindset in both to write lots of procs/words to do one's work.


Several Forths have bound to Tk for their GUI toolkit needs. V6 [L7 ] is a commercial Forth based on Gforth available for Linuxes (and *BSD? and MacOS X?).


Zarutian 24. september 2006: Does an Tcl interpreter in Forth exists?

Zarutian 27. september 2006: Or do I have to write one?

wdb Please yes!

Zarutian 20. june 2007: Hmm... that would require Forth words for:

  • string manipulation (slicing and splicing)
  • string comparision

and something more probably.

tb 17. july 2007 - @wdb: Do you think of a string stack? How much of a FORTH system would be appropriate for emulation? A true 2stack machine with a "Dictionary space", an "Inner interpreter", an "Outer interpreter", compilers and defining words, complete with its own command loop?

escargo - It might be interesting to have a PostScript[L8 ] system instead; PostScript is both a stack-based VM and has strings and dictionaries.


[ Category Language ]