5 ms·
Forth is a mindset as much as a programming language. It is a language for minimalists. If you can solve your problem efficiently in Forth, you can be confident
by diffxx 4y ago
Forth is a mindset as much as a programming language. It is a language for minimalists. If you can solve your problem efficiently in Forth, you can be confident that your solution will work in essentially any computing environment. Unlike C, the core of Forth is small enough that a single individual can implement it in a few days at most.
This is incredibly liberating because you will realize that you will never be seriously hindered by the tools provided to you because the Forth way is to just write your own tools. Of course this goes against the modern programming culture which has become extremely maximalist and makes you dependent on complex tools like VSCode + LSP in order to be productive. There is another way.
The language itself leaves a lot to be desired, in my opinion, but the core idea of having a small extensible compiler around which one can build efficient problem specific DSLs is brilliant. Unfortunately I think it is too easy to get bogged down in the bad parts (or at least parts that appear bad to our modern programming sensibilities). For a good overview of what makes Forth special, I recommend Thinking in Forth https://thinking-forth.sourceforge.net https://thinking-forth.sourceforge.net even if you never expect to program in Forth. It was written in the 80s but it still holds up. Read the first 80 pages or so carefully and I can almost promise that it will change the way you think about programming in a good way.
Once you have internalized the Forth mindset, you don't need to actually write Forth code. But you may be grateful that Forth taught you how to find your optimal programming language that exists somewhere inside of yourself.
- haolez 4y agoForth is an important skill for a zombie apocalypse. You can create a simple computer, with a simple instruction set, and get a high level programming language in a short time :)
- kragen 4y agointerestingly enough, while this seems like an obviously good application for forth, i have never actually seen someone get to a working c compiler this way
- akkartik 4y agoThis recent project has a C compiler: https://git.sr.ht/~vdupras/duskos https://git.sr.ht/~vdupras/duskos https://lists.sr.ht/~vdupras/duskos-discuss/%3C69cfdb97-49d6-dccd-c7bb-df3b40eab7e6%40gmx.de%3E#%3C0a60f31f-2e2c-4431-909b-7fe0d63f5f81@app.fastmail.com%3E https://lists.sr.ht/~vdupras/duskos-discuss/%3C69cfdb97-49d6...
- kragen 4y agohey that sounds great i will take a look
- diffxx 4y agoA Forth programmer who bootstraps their own Forth probably isn't that excited about having a c compiler.
- kragen 4y agomaybe i don't qualify as a forth programmer then well, that's unfair, because https://github.com/kragen/stoneknifeforth https://github.com/kragen/stoneknifeforth definitely doesn't qualify as a forth, it doesn't have immediate words