the FORTH programming language [FIXME: lots of links scattered elsewhere to gather here ...] [FIXME: should this section go elsewhere ? perhaps robot_links.html or to_program.html ? or its own dedicated page ? ]
latest Forth news is, of course, at news:comp.lang.forth | http://groups.google.com/groups?group=comp.lang.forth ... also Wikibooks:Forth http://en.wikibooks.org/wiki/Forth , Wikipedia:Forth http://en.wikipedia.org/wiki/Forth , C2:ForthLanguage http://c2.com/cgi/wiki?ForthLanguage , fwiki http://fwiki.logilan.com/ .
[FIXME: should I dump all these links over to one of the Forth Wiki ? ]
-- Roger Ivie 2002-01-12 http://www.strangegizmo.com/forth/MachineForth/msg00055.htmlI also think I have some feel for what the minimum stuff you need to do a Forth is, and it's a lot different than folks generally think it is. Here's what mf knows how to do for a specific processor:
- - Generate a label
- - Generate code to load a literal
- - Generate code to call a word
- - Generate a conditional branch
- - Generate an unconditional branch
- - Spit out verbatim assembly code
It also knows how to copy comments from the source code to the generated assembly code, but that is (strictly speaking) not _necessary_. Given these, all else follows.
Sure, mf has its limitations; it can't convert tail calls into jumps, for example. But it's an excellent starting point and looks to be well-suited for my current project. And it's changed the way I view the universe, which is all anyone can ask from a learning experience.
the 4tH compiler http://www.xs4all.nl/~thebeez/4tH/foldtree.html has some advantages over most other Forth implementations: * 4tHs primitives check all parameters. (so ``4tH is an excellent platform to learn Forth. It looks and behaves like a conventional compiler, but essentially is Forth. A Forth that detects virtually every error and reports what was wrong and where it went wrong'' ... ``as far as we know 4tH cannot be crashed by a user-program.'' ) * 4tH is written in C
also has some IDEs ...
Build Your Own Forth!by Jack Brien http://www.figuk.plus.com/byof.htm
Subject: Re: Simple Forth written in C From: "Jeffrey R. Fox" Date: 2000/12/21 Newsgroups: comp.lang.forth
Phil Burk's pForth (http://www.softsynth.com/pforth/) is my choice -- I have used this system extensively under Solaris and Window/Extended DOS and even compiled it under OpenVMS. It is a 32-bit ANSI-C source ANS compatible Forth. I use it often to test C++ classes -- it is one of the few systems that will compile cleanly with the C++ compilers. It has the simplest design in comparison with Baden's ThisForth, GForth, ATLAST, Until, and PFE. It isn't anywhere near as fast as GForth, but there you must be compiling under GCC, and I still haven't been able to figure out how to get new C defs into it. If you are going to be without complete documentation, this is the choice. My interests are in portability and mixed language programming.
ThisForth also works very well, and while it uses the macro expander M4 to get from pseudo-Forth to C source before compilation, the true Forther might prefer that. Will Baden knows his Forth, and it has a wealth of macro features that are a gas. GForth will eventually be documented, and it uses something similar, though built-in, to do the translation. In PFE, the Forth words are just implemented as C functions, so that isn't hard either.
Jeffrey Fox, Worldcom
P.S. for good old DOS, I use ThisForth or I put the C/C++ in an interrupt callable TSR. If you want to mix C/C++ w/Forth under Windows, you can always put the C/C++ in a DLL and then call it from a native Forth like Win32Forth or the commercial SwiftForth (Forth, Inc.). The later costs money, but hey, you get a book, and boy is it fast. You can even make a Forth DLL so that your C/C++ mainline can call Forth.
P.P.S. Mitch Bradley (Bradley Forthware) used to sell a system w/source called C-Forth. I bought one of those, and always thought it was pretty good -- it fit well with Solaris, and I used it under DOS also.
P.P.P.S. Hey and if you want to substitute Java for C/C++, then take a look at FIJI, HolonJ, JEForth, etc. FIJI is a lot of fun, and HolonJ (shareware) is a complete programming environment.
P.P.P.P.S send me an email if you can't find one of these at www.forth.org.
Bill Sturm wrote:
> Can anyone suggest a very simple Forth language that is written in > portable C. Just to be able to create and execute dictionary words is > all that I need. A core group of words written in C would probably be > necessary. Speed is less important to me than simplicity. > > Bill Sturm
(end of original message) -------------------------
apparently written in 1993-1994.
`` My goal was to run Forth programs on a 68hc11 MCU in single-chip mode. This means no external RAM or EPROM, only the 2K of EEPROM and 256 bytes of RAM available on a 68hc811e2 chip.
...
Note that tiny4th is not a traditional Forth interpreter. It cannot execute Forth words ... ''
?]
see also linux.html#style_guides
see also machine_vision.html#fft for FFT programmed in FORTH.
see also book.html for some books on forth [FIXME: move here, just leave link to here at book.html ?] [FIXME: should I seperate out 2 lists: one dealing with implementation (direct-threaded vs. indirect threaded, etc.) (perhaps useful for OS writers) and one dealing with programming (tutorials, advanced ideas, source code) ?]
From: Fox@UltraTechnology.com Subject: Re: Top 10 Language Constructs (Forth) Date: 18 Jul 2000 00:00:00 GMT Newsgroups: comp.lang.forth ... I think people designing simple machines with simple software can benefit by learning tricks used on the complex machines and complex software. They can add them to their bag of tricks and use them where applicable. The same applies in reverse. There is still a lot of unexplored territory. -- Jeff Fox UltraTechnology www.UltraTechnology.com
"View from above. Build from below. Consider everything. " -- Jeff Fox 2000-07-17
Some people have speculated: Since 2 stacks are so much better than 1 stack, perhaps even more stacks would be better? (See also http://en.wikipedia.org/wiki/Stack_machine#More_than_two_stacks )
unsorted comments
... DAV: basically, I want to include the complete source code on the device ...
also, interactivity is really helpful in development ...
created 2006-02-09 (forked off from computer_architecture.html)
end forth.html