17 ms·
The whole context of this article is "how can we get C programmers to understand that they would be more productive in FORTH". My thesis is that maybe the attit
by tdeck 11mo ago
The whole context of this article is "how can we get C programmers to understand that they would be more productive in FORTH". My thesis is that maybe the attitude of "you should be writing everything from scratch, including (often) the FORTH environment itself" might just possibly have something to do with why people aren't jumping on the FORTH productivity bandwagon.
The number of C programmers whose use case is "I need to bring up this CPU with a never-before-seen instruction set" is a rounding error. The number who need to fit their complex logic into 1K of memory is small and dwindling every year. I can buy an ESP32 for less than a dollar.
Moreover, there's no technical reason why FORTH programmers can't write, share, and use libraries (except maybe the aforesaid plethora of incompatible language implementations). FORTH is great for creating neat little DSLs that solve a specific problem. Stacking these can be powerful, but if you personally don't want to use them, or it doesn't fit your use case, that's fine.
- andsoitis 11mo ago> "how can we get C programmers to understand that they would be more productive in FORTH" It could also be that they wouldn’t be more productive (given the kinds of software the typical C programmer writes). It could also be that that is the wrong question.
- saulpw 11mo agoThe reason C beats Forth is code-sharing. Forth is a better language and system on its own, but it's difficult to standardize for reasons both technical and cultural. So if you write some really wonderful code in Forth to, say, decompress a bytestream, another Forth programmer is unlikely to be able to use that code without substantial modification. So Forth becomes either a single-person or a small-team system at best. Larger teams can't grow (in part because onboarding to your particular Forth system is a non-standard process), and especially cross-pollination between teams and companies is not possible.
- ErroneousBosh 11mo ago> The whole context of this article is "how can we get C programmers to understand that they would be more productive in FORTH". They absolutely would not be more productive in Forth. If they're writing in an ultra-high-level language like C, they're unlikely to be targetting something where Forth would make sense. You need ridiculously powerful processors to run a C compiler, and your code is likely targeting some massive processor with possibly hundreds of kilobytes of code space. Forth and C inhabit entirely different conceptual spaces. > Moreover, there's no technical reason why FORTH programmers can't write, share, and use libraries None of the libraries you write will be of any use to me, and vice-versa.
- lioeters 11mo ago> ultra-high-level language like C LOL, thanks for the reminder that most of my career has been spent up in the stratosphere, towers upon towers of abstractions. Started re-learning C during pandemia for embedded systems and microcontrollers, feeling freer as I go deeper down the stack. Got into Lisp interpreter, then compiler and assembler. Had a chance to study eForth in this post, and it can get real close to the metal. > need ridiculously powerful processors to run a C compiler That's one thing I noticed while getting familiar with C, that it's a huge effort to write a compiler in itself. Whereas Lisp and Forth even more, creating a variant/subset of the language from scratch is an exercise for every student. These languages are hidden gems, even though they play such important roles in the history of computer science. They are relevant, perhaps now more than ever when people are losing touch with the ground, the basics of code and computation.
- tdeck 11mo ago> You need ridiculously powerful processors to run a C compiler It's not 1982 anymore. I can compile C just fine on SoC that costs $5. Of course it's true that these things are ridiculously powerful, but that doesn't really matter. The amount of silicon used is roughly the same as an 8051 from 20 years ago. I'm all about cool projects like building your own CPU out of 7400 logic gates or writing your own OS in assembler or whatever. But I personally feel that FORTH doesn't need to be limited to these kinds of toy projects where you're intentionally making things harder on yourself. However when I see discussions related to FORTH it seems like most projects fit into this category and there is little diversity.