Bashforth: A Forth interpreter, written as bash script
github.com
github.com
I think any grammar needs to cover immediate words because you cannot ignore CREATE… DOES>. Those can do anything, so how do you handle them?
There’s also BASE (the current number conversion radix). It makes parsing integers context-dependent.
One of it's biggest downfalls imo is that the toeknizer is too simple. I'm making GitHub.com/civboot/fngi as a "better than forth".
It makes a nice foundation for syntactic experiments.
Forth is a ball of mud that you start at the beginning and at the end you end up with a shiny turd of a https://en.wikipedia.org/wiki/Dorodango.
Forth is bottom up insted of top down. The concepts teaching/learning wise start at the bottom and lead up to the top. You can't learn that starting with Python or Fortran or C or BASIC, or even Assembler. Bottom up.
Forth might not be the best Pascal/Basic/Python learning some stuff language, but Forth is the best bits in memory to HLL "full-stack" language.
I wish your brother had done it on raw hardware instead of in Java. It is a really nice language for learning.
https://github.com/oilshell/oil/wiki/The-Biggest-Shell-Progr...
although there are a lot of whitespace and comments to get up to ~3800 lines.
The biggest shell scripts in the world seem to be about 10x bigger, around ~30K lines. Feel free to add any "program" that's more than 10K lines, and smaller ones if they are "interesting". (That's subjective, but I think a Forth qualifies.)
Edit: I'll get me coat
The nice thing about using bash is it implies the program is intended to be quick and dirty, and easy to deploy. Users might have to get their hands dirty- and they can since it is interpreted and interactive. Code reviewers usually respect this and don't hang you out to dry.
For them it's fun, for the readers it's a view into a weird world. Maybe it's just not for you, but not everything has to be for you.
If I’m building something professionally, then difficulty in building, reading and maintaining is a problem.
If I’m building something to learn or to be creative, I don’t worry about how difficult it is to build or read or maintain: my aim is different, and therefore so are my concerns.
Have you looked at the code? It's beautifully laid out, extremely readable, and completely maintainable. If you don't know bash it's a great example of how to create a reasonably complex program that's designed to be read and maintained.
And finally, yes, when taken as an opportunity to improve your skills, absolutely there is value in creating something as a vehicle for developing your abilities, to demonstrate to others that you have those skills, and quite simply, as a challenge.
From an interviewers perspective of "value", I would be both impressed at the perseverance demonstrated, but horrified at the deliberate masochism.
>completely maintainable
This is far less maintainable than a clean Forth interpreter written in Java. Maintainability is relative, so saying that something "is maintainable" has no meaning unless you compare it to something else.
>absolutely there is value in creating something as a vehicle for developing your abilities
I agree, but applying that to this is like saying "let's learn to build a house by using a hammer that has no handle, and a saw that is made out of raisins."
Do you do crosswords? Sudoku? Wordle? Do you play chess? Go? Backgammon? Do you play any video games? Do you watch movies? Do you play a musical instrument? Do you paint or draw?
If so ... why? What value do these provide for the rest of the world?
If not, fair enough ... that's just you, and maybe you won't ever understand that sometimes other people do things purely for the challenge, and sometimes on the way these things hone skills, increase knowledge, and provide satisfaction.
Using bash is perhaps unexpected, but it's not like writing machine code in raw, unadorned, inscrutable hex by toggling bits in through a front panel.
It's just a programming language, and it's interesting and instructive to see the end result, unlike watching someone playing chess with their pinky.
I don't see why you think it's so bizarre. It's not doing it in a way that's as difficult as possible .. really, it isn't.
But ... I guess I just won't understand your question.
I think I just don't "get it" and my pov is probably colored by frustrating interactions that I have at work where people do the similar things in code shared by others, to (seemingly) demonstrate "their skills."
Maybe that's simply the way it is, maybe you'll just never understand why other people do for pleasure things that you see no point in.
Sometimes it's just fun for them.
I occasionally ride a unicycle and juggle, just for my own satisfaction.
Do you do anything for fun?
But I acknowledge that I could be wrong too. Maybe they had a blast using Bash.
Also, for me, there’s a certain power that ubiquitous readily-available technologies like Bash have and I enjoyed browsing through what I see as an honest and clean exploration of its possibilities.
Because we (I) don’t have a Jacquard Loom.
I should start a go fund me to implement forth using a hand-built punchcard loom…