7 ms·
I used Forth to explain numbers in different radices to my grandson. Being able to interactively try things at the console was really helpful. It also helps to
by lebuffon 2mo ago
I used Forth to explain numbers in different radices to my grandson.
Being able to interactively try things at the console was really helpful.
It also helps to separate the internal number in the machine from how we display it, due to the different operators to print numbers as signed or unsigned. This is something that I have seen young programmers confuse.
I think another area where Forth can help young people is in understanding some low level details like memory addresses and reading and writing memory. It seems simpler than abstracting it to "pointers", more like assembler but interactive.
- rwmj 2mo agoWouldn't something like Python be better for interactivity?
- lebuffon 2mo agoForth is very good in this regard, because the word names are short and there is no "fluff" around the syntax if you can even call it syntax. Also there is no need to name your data. Literal numbers can be used just as easily even for memory addresses. However there is no safety net. ;-)
- exe34 2mo agoAside from shooting yourself in the foot, I don't see anything you've shared that can't be done in python.
- lebuffon 2mo agoOf course not. I was merely expressing that Forth makes interactively very easy. And like all languages, it is impossible to evaluate them if you don't use them for some significant amount of time.
- exe34 2mo agoPython also makes "interactively" very easy!
- lebuffon 2mo agoThe "no safety net" means that Forth is a low level language. You can touch anything in the machine. Many times it is used without an O/S. So if you push a random number onto the hardware stack you will get burned.