is anybody using the Forth language ? - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: September 10, 2013, 04:16:44 pm
content: if so, could you explain me the advantages ?it was said that it could help you to rapid prototype about robotic stuff, i wandering why.Also, could you suggest- a pretty implementation of Forth in C- a pretty book/doc that could train about "thinking in Forth"- a pretty example of usage in real life

author: Balaur
author_rank: Unknown
timestamp: September 10, 2013, 08:53:43 pm
content: Heh, that brings back some memories.I've dabbled in Forth on my Sinclair Spectrum. I didn't have any reasons that I was young, curious about everything and there was no Internet to sink my time and attention.I was very happy with Forth at the time: fast, efficient and modular. I was able to seamlessly extend the interpreter with new words, run times were much nicer than equivalent Basic programs; even RPN seemed natural in that context.Why use Forth now? I honestly have no idea. There is a plethora of information on net; pick one. There are nice interpreters available: gforth, win32forth, ...Best regards,Dan

author: legacy
author_rank: Super Contributor
timestamp: September 10, 2013, 10:12:19 pm
content: wandering if i can put a forth implementation on 68HC11, i have only 32Kbyte of ram.

author: legacy
author_rank: Super Contributor
timestamp: September 10, 2013, 10:17:50 pm
content: it seems possible,here

author: free_electron
author_rank: Super Contributor
timestamp: September 10, 2013, 11:06:32 pm
content: Matrix uses forth on a Z80 to control their entire strippers. (strippers are machines that remove the photoresist from silicon wafers by exposing them to an oxygen plasma. ) the robot controller driving the wafer handler had a forth interpreter.you could hook up a simple terminal hit ctrl-c and type forth commands on the command prompt to control the machine.Forth is RPN . it is stack based. you push stuff on the stack and then pop it off as it is executing. weird language,

author: grenert
author_rank: Frequent Contributor
timestamp: September 11, 2013, 02:26:42 am
content: "Starting Forth" by Leo Brodie is considered a classic text in learning FORTH. However, it's very old and I don't know how applicable it is to modern FORTH. On the positive side, it is available for free online:http://www.forth.com/starting-forth/I've always wanted to learn FORTH because after 30 years of HP RPN calculators, the stack is really intuitive to me. However, I have not been able to figure out how to get around the lack of floating point arithmetic (may be present in some versions of the language, but traditional FORTH was apparently integer only).

author: edavid
author_rank: Super Contributor
timestamp: September 11, 2013, 02:50:23 am
content: Quote from: legacy on September 10, 2013, 04:16:44 pmIt's self compiling, and includes an interpreter.Nowadays you can easily get good compilers for small CPUs, and compile time is a non-issue. So, it no longer has any real advantages.The big disadvantage is that it tends to be write-only... often, not even the author of a Forth program can understand it.

author: westfw
author_rank: Super Contributor
timestamp: September 11, 2013, 05:52:18 am
content: QuoteForth occupies a sort of "sweet spot" between interpreted languages and compile languages. Usually a forth implementation is faster and smaller than most compilers, while retaining the interactive aspects of an interpreter (not ALL interpreters stress interactivity these days. but Forth does; you can type commands and get them to work immediately. I once wrapped a Forth superstructure around a Fortran graphics library, just so I could quickly try out the various "interesting" graphics calls.)QuoteProbably the availability of that interactivity. You can write a Forth "word" so you can do things like "100 forward stepmotor", and then use it either interactively, or in a bigger Forth program.QuoteForth is designed to be implemented on top of a pretty bare machine. A C implementation is not likely to be "pretty." (some assembly language versions are extremely elegant. Not all. It surely helps if you can easily implement TWO stacks, for instance.) There ARE C versions...QuoteBrodie's book.IMO, Forth's biggest weakness is that it didn't catch on to this whole "filesystem" thing that started happening to microcomputers. You go along figuring things out and it's all pretty cool till you get to this archaic disk stuff based on reading raw disk blocks. Perhaps newer forth has something better.QuoteIIRC, The SUN Rom monitor/bootstrap is written in forth. Also, Postscript is very forth-like.As someone said, Forth isn't very pretty to READ.By all means check outhttp://www.forth.org/QuoteAlmost for sure. 32k is a large system by forth standards. "amforth" for the AVR is about 8k of flash, 200 bytes of RAM, and 100 bytes of EEPROM for its core, for instance.

author: BravoV
author_rank: Super Contributor
timestamp: September 11, 2013, 06:00:41 am
content: Quote from: edavid on September 11, 2013, 02:50:23 amDon't know bout Forth, but geez.. really ? I find this statement funny.

author: westfw
author_rank: Super Contributor
timestamp: September 11, 2013, 06:47:17 am
content: QuoteWell, super-efficient interpreted language from the pre-disk era. Comments take up space! Meaningful keyword names take up space! So... Yeah. I assume it COULD be better now (and I've seen/written well commented postscript programs, so...)Not as bad as other languages from the same era. APL took similar "limitations" and added a whole new character set (with overstrikes!) TECO was, well, indistinguishable from line noise.

author: JuKu
author_rank: Frequent Contributor
timestamp: September 11, 2013, 07:07:41 am
content: Re: is anybody using the Forth language? Yes, but not anymore. Some years back, I did work to a networked multiprocessor system based on Forth.Quote from: legacy on September 10, 2013, 04:16:44 pmSorry, I can't. There is none. Forty years ago, when the development stations did not have disks and there were no compilers (assembler was hand-compiled) it was great. But in real life (and I've been there!), we now have compilers. By my experience, Forth is significantly less productive than any other language I know of, assembler included.

author: legacy
author_rank: Super Contributor
timestamp: September 11, 2013, 04:26:19 pm
content: "Starting FORTH", good resource

author: Crazy Ape
author_rank: Regular Contributor
timestamp: September 12, 2013, 03:31:02 am
content: An online FORTH interpreter.http://forthfreak.net/jsforth80x25.html

author: Bored@Work
author_rank: Super Contributor
timestamp: September 12, 2013, 06:01:25 am
content: Quote from: BravoV on September 11, 2013, 06:00:41 amThe moment someone pulls the trick on you to have code in some Forth application to modify the way the compiler works from inside while compiling, you really need to sit down, exclude distractions, saya few times, have a stiff drink (but only one) and start to think hard to understand what is happening. At least if you don't do Forth daily for at least 20 years.But that is not really the most annoying part. The annoying part is that "they" always try to sell you Forth as a cult, a philosophy, a religion. If you read the 30 year old publications of the FIG or old books about Forth, and there isn't much new material available, it is always about "everyone else does it wrong, tomorrow Forth will concur the world, go with the program or you will be extinct". I didn't like that then, I don't like it today. Imminent world domination since decades ... And it always comes with stupid stuff like "tho shall have no real editor", "tho shall have no real file system" "tho shall not use variables".

author: westfw
author_rank: Super Contributor
timestamp: September 12, 2013, 06:20:23 am
content: QuoteWow. I frequently disagree with things that "Bored" says, but that's a fine statement of the things that always felt wrong about Forth. Implement it, play with it, use it where appropriate. But don't become a zealot...

author: andyturk
author_rank: Frequent Contributor
timestamp: September 12, 2013, 08:12:49 pm
content: Ah, brings back memories....Byte Magazine Volume 05 Number 08 - The Forth Language (August 1980)

author: westfw
author_rank: Super Contributor
timestamp: September 13, 2013, 12:58:53 am
content: I also liked the articles by Richard Fritzson in Feb/Mar 1981 issues of Kilobaud Microcomputing Magizne.At least, that what I painfully transcribed into my homebrew assembler and tried to run on my homebrew 8085 simulator. IIRC, it didn't quite work, leading to an epiphany about the failings of having too many unproven steps on the way to a single goal.(I guess the 8085 simulator basically worked. It (slightly) later inspired/became a commercial CP/M simulator. Not from me, though. (another interesting lesson.))