3 ms·
Related advice would be to annotate every stack effect with a comment, no exceptions. Back when I was into Forth, I had this wild notion of adding a stack chec
by samatman 6y ago
Related advice would be to annotate every stack effect with a comment, no exceptions.
Back when I was into Forth, I had this wild notion of adding a stack checker, defining two additional comment words which would be aware of the stack effect of all core words, and require a stack effect to be defined for every new piece of vocabulary.
Never did anything with it, don't write Forth anymore, doubt I will again. I still think it's a good idea though, so I like to put it out there.
- TapamN 6y agoThat's actually been done. It's called StrongForth. http://www.arestlessmind.org/2009/02/03/intro.html http://www.arestlessmind.org/2009/02/03/intro.html
- MaxBarraclough 6y agoYou beat me to it. See also this other page on StrongForth: https://www.stephan-becher.de/strongforth/ https://www.stephan-becher.de/strongforth/ See also the Kitten programming language, which does something similar: https://kittenlang.org/ https://kittenlang.org/
- dfischer 6y agoHave you seen Factor? https://factorcode.org/ https://factorcode.org/
- cblum 6y agoYep, annotating the examples with stack effects is in my plans :)