4 ms·
I tried to learn it, and found Forth to be an obfuscated, write-only language. Forth programmers give a lot of lip service to writing short, well documented, e
by pmoriarty 10y ago
I tried to learn it, and found Forth to be an obfuscated, write-only language.
Forth programmers give a lot of lip service to writing short, well documented, elegant words (functions) but in real-world programs I've seen the opposite: the tendency has been to long, poorly documented, and convoluted words. (At least that's been my experience with open-source Forth programs. I've heard the libraries for commercial Forths are of much higher quality, but I have not verified this myself)
Forth has been compared favorably to Lisp, but I found them to be like night and day, and Lisp (and especially Scheme) to be far more elegant and easy to both read and write.
Forth might arguably be better than assembly, but unless you have a pressing need to write the tiniest programs possible (like on some resource-starved microcontroller), I'd be hard pressed to find a reason why you'd want to use Forth instead of some higher level language that is far less painful to work with.
In fact, I've even heard some Forth fans themselves say that the point of using Forth is to write yourself something as quickly as possible that lets you program in a higher level language.
Don't get me wrong, I really, really wanted to like Forth and spent a lot of time trying to learn it, but in the end it felt like it just wasn't worth it. I might give it another go if I get heavily in to programming microcontrollers where Lisp or Scheme is not an option.
- Someone 10y ago"Forth has been compared favorably to Lisp" In some contexts, that's true. Lisp needs insane amounts of RAM to get a decent REPL running (I can't find figures for the original 704 implementation (did it even have a REPL or was it compiled?), but I guess easily 20kB or more), while forth runs its REPL happily in a tenth of that space. If you are bootstrapping the firmware for a device, where bootstrapping means that you have to write the code interfacing with any of the hardware before you can use it, and you can find enough I/O pins to use for a serial port, a forth REPL is both easier to implement and way more useful than a lisp one. And if your device doesn't have much memory, it may be your only realistic option.
- greghendershott 10y ago> In fact, I've even heard some Forth fans themselves say that the point of using Forth is to write yourself something as quickly as possible that lets you program in a higher level language. That was the main point for someone I know: Forth was how they'd bootstrap a new system to be useful in a few days. I don't think they do this anymore. This mattered more in say the 1980s when truly new personal computer hardware was coming on the market fairly frequently.