Here we go again :) I've written a ton of Forths over the years in different languages, and every time I run into an article about it I get the itch to do another one.
What the hell is Forth? (2019)
81–90 of 138 posts
Re: What the hell is Forth? (2019)
#82I believe that any programmer should at least know a little about Forth. It's like Lisp. Just knowing about them is extremely enlightening, even if you don't use them in your daily life. Obligatory link: https://github.com/nornagon/jonesforth/blob/master/jonesfort... This well-written tutorial will have you implement a Forth in 500 lines of assembly and another 500 lines of Forth. You will feel like a different perso…
Agree with the parent, it's a language worth knowing like LISP is worth knowing, but (unlike LISP) it is not a good language choice for almost all use cases in 2023 (almost all use cases are not that memory constrained any more, even embedded systems), for the same reason you shouldn't use Perl (it is very hard to read code). I was going to say "its main disadvantage is that the only way to find out what a piece of c…
Re: What the hell is Forth? (2019)
#83Re: What the hell is Forth? (2019)
#84Earlier quoted context omitted.
Agree with the parent, it's a language worth knowing like LISP is worth knowing, but (unlike LISP) it is not a good language choice for almost all use cases in 2023 (almost all use cases are not that memory constrained any more, even embedded systems), for the same reason you shouldn't use Perl (it is very hard to read code). I was going to say "its main disadvantage is that the only way to find out what a piece of c…
I don’t really feel I can judge whether it’s good or not to use generally, but it’s difficult to obtain a similar degree of DSL-ness even on pretty powerful (e.g. Micropython-grade) constrained platforms. Forth, along with Lisp, is one of the original DSL substrates ( Thinking Forth spends like half its pages on preaching EDSLs), and I don’t think it’s really been supplanted in that niche by anything that doesn’t req…
Re: What the hell is Forth? (2019)
#85A great introduction is the book Starting Forth [0]. It has the most charming illustrations I've ever seen in a text book. [0] https://www.forth.com/starting-forth/
Lately Lisp and Rust have begun to take on religious overtones, but Forth came first.
It is probably also a mistake to introduce it without mentioning that the first two (normally one-character) words defined are pronounced "builds" and "does".
Re: What the hell is Forth? (2019)
#86Metacompilation re-uses the live, running interpreter/compiler to compile a new system image of itself, from source code.
Re: What the hell is Forth? (2019)
#87I don't think the article mentions metacompilation, which is a further cute and mind-bending feature Forth is known for. Metacompilation re-uses the live, running interpreter/compiler to compile a new system image of itself, from source code.
Re: What the hell is Forth? (2019)
#88I started using Forth because I wanted a Reverse Polish Notation calculator at the command line. It turned out to be very practical and extensible. For example, I created many words to perform unit conversion, such as temperature: : 2fahrenheit 9 * 5 / 32 + ; : 2celsius 32 - 5 * 9 / ; Furthermore, I can even pull in live currency conversion rates from Yahoo Finance to go between USD and CAD. Since my underlying Forth…
Reminds me a bit of dc: https://en.wikipedia.org/wiki/Dc_%28computer_program%29