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] Or: Forth consists of words (commands) that exchange parameters on a stack. This simple concept implies ''postfix notation''[http://www.spsu.edu/cs/faculty/bbrown/web_lectures/postfix/] and [RPN] in mathematical expressions. http://www.forth.org/ FORTH in tcl anyone? * [A different FORTH] -- [JBR] * [Trying FORTH in Tcl] -- [jcw] * [RPN in Tcl], [RPN again] -- [RS] * [HP Calculator Simulations] * [GPS RPN] -- (Forth-like) [GPS] * [HolonTForth] -- [wej] Chuck Moore created FORTH in 1970. An interesting article about FORTH appeared in ''Byte'' magazine [http://www.colorforth.com/byte.htm] . Related to this is [1% the code] a shocking paper by Chuck Moore. Tutorials * Brief Introduction [http://www.ece.cmu.edu/~koopman/forth/hopl.html] * And so Forth (a primer)[http://www.xs4all.nl/~thebeez/ForthPrimer/Forth_primer.html] * Comprehensive (for 4tH)[http://www.geocities.com/SiliconValley/Bay/2334/4thtutor.htm] Leo Brodie's "Starting Forth" as a [starkit] for [Microsoft Windows]/[Linux]/[Solaris] can be found here [http://www.equi4.com/pub/sk/brodie_sf.kit], based on the web version of the book at [http://home.iae.nl/users/mhx/sf.html]. [AK] This [starkit] seems to need a package 'scripdoc', which is not in the [starkit]. [LV] That package was a part of the original [tclkit]s. It still is in my [tclkit] of [tcl] 8.4.9 for sparc solaris. Perhaps it isn't in the tclkit lite? ---- 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 [http://www.amresearch.com/v6/] is a commercial Forth based on Gforth available for [Linux]es (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 comparison 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? -- [wdb] Not a string stack, but some creations with ''''. All strings shall be unique, identified by their memory address, and be immutable. Depending on operations, values internally implemented with multi-pointer (one for string-processing, one for list-processing, one for float-processing), where not-used or outdated pointers are reset to null. -- I'm just dreaming of a '''very''' high-performant Tcl ... ''[escargo]'' - It might be interesting to have a PostScript[http://en.wikipedia.org/wiki/PostScript] system instead; PostScript is both a stack-based VM and has strings and dictionaries. [LEG] 20070919: just implemented [f4t]. Why would you want to do string processing on stacks in Tcl? Why would you want to implement just another graphics language in Tcl. Both things are handled fine in Tcl/Tk. IMO Forth in Tcl should enhance, complement Tcl in an area where Tcl needs it or where Forth functionality is nice to have. [wej] 2008-04-29: If you want to write Tcl programs in Forth: [HolonTForth] compiles Forth to Tcl source files and uses Tcl as the Forth machine. ---- [ZB] 06.07.2008. - Every description of Forth focuses on using stack, RPN and so on - but I'm interested in such trivial things, like f.e.: is it possible to write Forth-programs with nice user interface (at least curses-based, if not Tk/GTK-like GUIs)? Any examples? Is event-based programming possible using Forth? A google-search for "event-based programming in forth" revealed nothing. [tb] 2008-07-07 - Yes, it should be possible by creating an event stack, holding addresses of handlers (as a first approach), but you'd have to program and enter your own event loop, because a classical FORTH inpterpreters loop only recognizes ONE input stream, which must be ASCII characters. ---- !!!!!! %| [Category Language] |% !!!!!!