4 ms·
Forth is truly amazing in terms of what you can do with very little RAM and CPU power. It is quite possible to have a working interactive development environmen
by dwheeler 7y ago
Forth is truly amazing in terms of what you can do with very little RAM and CPU power. It is quite possible to have a working interactive development environment and production implementation in only 4-8 kibibytes of RAM. In the world of small memory 8 bit computers it was amazing.
I think Forth can be useful to learn today, at least to stretch the mind to realize that not all programming languages have to be variants of Algol. It can also be a fun game as suggested by the article. I have enjoyed fiddling with it, including re-implementation of the language, and I can recommend it to others as a fun Bazaar toy. In addition, the book Starting Forth is amazing and still worth reading, because it shows that complex topics can be explained clearly and with humor.
However, for actual production use, I do not think the Forth programming language is ever going to return to widespread actual use. Our computer systems are far more capable, and if you have to program a tiny of computer, you would use a larger computer for programming instead of trying to fit your development environment within a few K of RAM. Nowadays the big constraint is development time, including the time to develop the resort code the time to read existing code to modify it. Forth doesn't do as well by those measures. When something is trivial another languages, but it's a puzzle to solve in Forth, that is not a good thing. That does not mean that Forth is a bad programming language, it is a very good programming language, but it is designed and optimized for a situation that is increasingly unlikely.
- ddingus 7y agoI have known an embedded engineer for probably a decade now. He uses Forth. I watched him write a tiny forth kernel in a Kb of RAM or so, then run a dictionary through it to get a brand new CPU bootstrapped in what could be as little as a day. Very impressive. That system got an assembler / disassembler used to make new system words and other words fast. Modifying a Forth system, and I say that due to how Forth is really an environment that becomes capable of the application, depends lot on who made it and what one can know of their thought process. What I thought interesting about this guys approach us a fairly pure Forth is used to bootstrap. Then one that is a lot more comfy gets made for the longer get term. Once that stage is reached, and there are good tools, assembler / disassembler, monitor, word viewer, etc... Forth can be made less of a puzzle. One can even add other syntax, an interpreter, if desired. The product is more like a dev system, self hosted and capable. I find it all compelling, but as you say, much different.
- kjs3 7y agoTo be fair, that's kinda the use case for Forth in the modern world: embedded development, single, capable developer, bootstrap something minimalist up and get it stable, create a DSL to solve the problem.
- dwheeler 7y agoThat's a plausible use case. Question is, if the engineer goes away, how long would it take to replace him? Languages do not take too long to learn, but Forth programs are often hard for others to read. I think most people prefer cross-compilation on small systems for professional use. If you are doing it as a hobby, ignore everything I just daid. I see the fun in it, and applaud it. Enjoy!
- ddingus 7y agoAgain, depends on how the Forth is done. Counter question: Given the obvious savings, why not invest some of that into a second person to retain a clear advantage? Do what most people prefer and get results that most people get. There are other ways to success.
- dwheeler 7y ago> There are other ways to success. Absolutely. I've played with Forth many times, and enjoyed it. But when it comes to building systems that people pay to develop & maintain, I haven't found any use cases recently. No doubt there are some, but I suspect they're much less justifiable today.
- FpUser 7y agoAges ago when I was doing mostly assembly, I was introduced to Forth. After few tries I've decided that for it was more of a mental exercise and nothing good will come out of it. I've felt that it was actually more easy for me to program in machine codes (I've done some fair share of it too). No not my cup of tea but I guess other people put it to a good use.
- dwheeler 7y agoI mentioned the book "Starting Forth". You can get a lightly-updated version of the book for free here: https://www.forth.com/starting-forth/ https://www.forth.com/starting-forth/ There are other books about Forth, but this one is really its own thing :-).