by SimHacker · 13y ago · 0 comments
I love Forth: I don't use it any more, but I'm glad I used it a lot in the past.
Programming in Forth is like doing power push-ups with weights, that make you stronger when you're programming in other languages.
It's a "glass box" and you just have to (and CAN, because it's so minimal) memorize not only the name, inputs and outputs of every word, but even recite their implementations in terms of other Forth words. It's simple and elegant enough that you can understand and get your head around the entire system, in terms of itself!
And then when you're writing code, you also have to remember what is on your stack between every word, which changes with every word, or you write explicit stack comments at the end of every line to keep track of them, if you're weak.
After Forth, programming in other higher level languages that let me (gasp) name my variables so they would stay in one place and be associated with meaningful symbols, instead of having to carry them around in my head and and shuffle them around on the stack, it was like slicing butter with a hot knife!
I did a lot of PostScript programming after Forth, but that was easy because PostScript has dictionaries that you can use for local scopes (and which can be used to implement a multiple inheritance object system like smalltalk's), so naming variables is acceptable, and you could keep the stack pretty shallow. Plus PostScript is just a lot more like Lisp than it is like Forth.
I’m writing a statically typed functional stack-based language called Kitten, in which the type system and local variables help you work compositionally and avoid managing the stack. It’s not yet ready for prime time, but you might be interested in following its development. Check it out!