|
|
|
|
|
by sandwell
1983 days ago
|
|
I've seen a lot of embedded Forth stuff recently but I don't get the appeal. Clearly there is some benefit over writing assembly, but why is it preferred over portable C, or even higher level languages such as Python on more powerful mcus? FWIW I felt the same way about LISP for a long time until I fell in love with it via Emacs. So please educate me! |
|
The main feature of the Forth style is to write lots of 1 to 2 line functions, in such a way that at the high-level, you have essentially a domain-specific language that looks like exactly what you want a program to look like - for example, "RINSE WASH CYCLE SPIN STOP" for a washing machine program, and "RINSE WASH RINSE WASH CYCLE SPIN STOP" for an extra clean option.
People claim that once you learn Forth, you start programming Forth-style in other languages like C, Python etc. I can already see the appeal.