3 ms·
FORTH is less a programming language and more a religion or philosophy on how programs should be written. The philosophy basically suggests that one should make
by gaze 7y ago
FORTH is less a programming language and more a religion or philosophy on how programs should be written. The philosophy basically suggests that one should make programs as simple as possible... way, way simpler than a modern programmer might think "as simple as possible" means. This philosophy clicked for me when I saw the segment in the colorforth manual saying "if the cursor doesn't appear on screen, hold up and left until it does." Why bounds check if it isn't necessary?
Ultimately a language is there to make programming a CPU easier. If you believe in just absolute minimal complexity, FORTH is what you get when you find this intersection of leverage vs. minimal tolerable complexity. A FORTHer generally doesn't believe in writing device drivers so much as writing maybe 20 lines of code yourself that twiddle the registers to get done what you want. You're basically told to ask yourself over and over again "do you really need that?" The answer is usually "well I might need it tomorrow... maybe..." but in software, requirements change so fast that the abstractions we design for what we think we might need tomorrow don't actually match what's actually needed. The FORTHer solution isn't to just continue generalizing until you have a fully galaxy brain interface that could accommodate anything the future could throw at you-- it's just to not generalize at all, and to put the weight of working in a system with less abstraction on the programmer. The bet is that the weight of dealing with less abstraction is less weight than dealing with a tower of abstractions that were built for the wrong requirements.
I don't know if I fully buy it, but it's worth trying to think like a FORTHer as an intellectual exercise to make you a better programmer.