4 ms·
I am under impression that more people implement Forth than use it for programming...
by whobre 1y ago
I am under impression that more people implement Forth than use it for programming...
- dcreager 1y agoThat's okay, it's a fun thing to do!
- rep_lodsb 1y agoA great article about why this might be: https://yosefk.com/blog/my-history-with-forth-stack-machines.html https://yosefk.com/blog/my-history-with-forth-stack-machines...
- desireco42 1y agoIt is educational thing to do. Like Lisp as well.
- anthk 1y agoWith Lisp you have beasts like Guile and Guix with Scheme and with Common Lisp, Maxima, Nyxt and even weird stuff like K3D or whatever was called where you could build 3D scenes while programming. A la PovRay, but with Common Lisp and in-place editing instead of batch rendering.
- juancn 1y agoIt's a great exercise as a programmer to implement a language, Forths and Lisps are popular choices. It greatly helps conceptualizing computation and what's truly essential at it's core.
- kabdib 1y agowe used FORTH extensively in the bring-up of the Atari ST. it was easy for the hardware engineers to come up with little fragments of FORTH so they could exercise their chips without needing much support from the software team FORTHs are fun to write. they'll teach you a lot about ruthless simplicity i don't think FORTH is useful for large programs, but that's not the point of the language
- johnisgood 1y agoWhy is it not useful for large programs (if you keep your words small)? What about Factor?
- ofalkaed 1y agoLarge programs mean lots of word definitions and essentially writing a DSL, most are not going to document that DSL well enough to make the code readable to anyone else and how many people want to learn a weird adhoc language myopically designed for building one program? I love Forth but it mostly died for good reason. Once you learn its workflow and develop your dictionary it is incredibly quick and easy to use but it will be a chore for anyone else to understand and work with.
- johnisgood 1y agoSo if it is documented well, then it would be suitable for large-enough programs? Or do you have any tips?
- ofalkaed 1y agoI think it can work but it takes a different way of looking at things. The main thing is that you need to take the time to design that DSL from the start and stick to it, if you come to a place where the DSL can not do what you want you need to address the issue with the DSL instead of just falling back onto the underlying Forth. It is a very different way to program and at times you find yourself have to make massive changes to the DSL you designed which also means changes to the program you are using it to write. DSL is probably not quite the right word, it could be but generally I think it is still going to be fairly Forth like, but you need to think of it that way. You layout what your program does and then reduce it to a few dozen words which work as a description language for the program, then maybe a 100 more words which those words require along with any glue and together all constitute a reasonably sane language. Then you start from the bottom up and implement all those words. The big trick is having the foresight required to pick the function of each of those hundred odd words well enough that no one will ever have to dig into the the 1000 odd words below that it took to implement them. It really forces you to think about how your program may evolve and the bugs which may crop up, you can't change one of those low level words without affecting all that are built on it and if you do the easy work around things start to get messy. Not sure how well I explained that, I am no Forth expert but I am getting better.
- jes5199 1y agothere's a myth I know where the true Forth enthusiasts end up making their programs so pure that they start needing their own special hardware (in one version, I heard that machine words were all 13 bits), their own networking stack, their own communication apps. Until eventually they transcend into a second internet, populated only by forth hackers, where everything is optimally elegant. and that's why we don't hear from them anymore
- novosel 1y ago[Drinks] O true apothecary! Thy drugs are quick. Thus with a KISS I die. [Dies] ((One W. Shakespeare Romeo and Juliet.))
- kbelder 1y agoThat's kind of by design, and it's why the standardized ANSI forth sucks. It will often be simpler to rebuild the language on your system the way that works for you, than to hammer a generic forth into what you need.
- aap_ 1y agoI always joke that forth doesn't actually exist. The only forth code that seems to exist is forth implementations.