colorForth (2009)
colorforth.github.io
colorforth.github.io
Sure FORTH has problems of its own, but it's always nice to use. I've hacked up a couple of simple FORTH-like systems over the years, most recently this one which was inspired by a thread on this site:
A lot of people go through guides of writing a lisp, I'd love to urge people to try writing a simple FORTH interpreter instead, or even something somewhat related such as TCL.
Once they're not interesting anymore, Lisp is the next step.
See, that's the problem. Writing a Forth interpreter, to be blunt, is not writing in Forth. You should be writing applications in Forth, not interpreters. It's great to marvel at the simplicity of a Forth interpreter, until you have to use it in anger for an actual application.
I've made several semi-serious "hobby" stabs at working with Forth, and, for me, it's a tough row to hoe. I look at something like F83 and marvel that someone was able to pull that off in that environment. I simply don't think I've used it enough and cross the line where I'm not constantly fighting...something to get anything done and thus my projects (or my patience) get derailed and I move on to something else. I've never gained any real momentum. F83 is actually quite robust (given it platform), and while gForth and such are better, it's not THAT much better. The core language is the same, though there are some more utilities.
My Pooh brain may simply not be able to cope with it properly. Could just be me. But a lot of Forth practitioners are kind of tired of all the "Look I have my own Forth" posts, vs actual working code doing something interesting besides Yet Another NEXT.
The Forth "enthusiast" community reminds me of the Pharo community. A community focused on writing Pharo to write Pharo, rather than applications on top of Pharo. They're constantly rewriting something (and making great strides!), but in the end you just get a great tool for making a great tool, and nobody (it seems) is making actual projects with it.
A lot of folks get a lot of "stuff" done using all sorts of languages and such, and showcase their wares, with the focus being on the application and the problem they solved. Forth focuses on Forths. And I know this is not universal, folks use it every day in industry and such, and there's even a couple nice videos showing "Forth in action", but much of the notoriety of Forth is the simplicity of the system, rather than the applications written on top of it.
I get the impression Chuck Moore would argue "writing in Forth" means designing a custom language and custom hardware in tandem.
Forth interpreters were traditionally written in Forth, and if you do it that way, that counts imho ;).
The idea was that I would code the interpreter in Python because it's a nice language to get shit done in. Then I would port the code to php for easier hosting.
In the end, I never did the php part, I just hosted the python game code on a cheap vps.
Had I known I'd end up on that route I would probably just embedded inline python code, but getting my own custom language working was great fun.
As always when colorForth is mentionned, I'm personally colorblind so I'm glad stuff like that isn't more popular. The red takes me a long time to parse, especially if I don't know the part is supposed to be red. There is a value in plain text.
Keep in mind he generally builds these things for himself based off of his own needs. I can't remember if this is default for the GreenArrays chips though, so perhaps that doesn't hold in all situations.
I think that would be terrible too but people seem to love their fancy fonts, italics and ligatures, at least in the JS world, like here https://miro.medium.com/max/1200/1*hE_nLB776KUDXPERE_3cXw.pn.... I honestly don't see the point and find it harder to read but to each their own.
> Keep in mind he generally builds these things for himself based off of his own needs. I can't remember if this is default for the GreenArrays chips though, so perhaps that doesn't hold in all situations.
This was more of a general comment about the idea.
I wonder if simply choosing better colors depending on the type of color blindness would be a quick fix, starting with not using red and green.
Silicon Valley programming wiz finds himself transported to a magical world. Spellcraft is archaic and stagnant. What's a curious hacker to do? Bootstrap a new magical 'programming' environment - using Forth, obviously!
Great fun!
I've watched a couple of episodes and went started my own. I learned a bit of arm64 assembly, and now I have both an interpreter and a compiler to M1 binaries. Very fun experience.
One day I'll slap a F#/OCaml'esque syntax on top of it with typed functions, structs, interfaces and see if it works.
At their core(it seems to me), concatenative languages are about function (words) composition.
So, instead if having "words", I would make them functions, with typed arguments, and simple argument matching (no more dups and swaps). This would probably make the language less flexible, but will make it more readable.
Anyway, FORTH is nice.
Interesting idea. Wouldn't it require some compiler magic, though? E.g. you can't type a Y combinator.
What I mean is that FORTH words seem to be functions taking stuff from stack and pushing stuff back. The composition is done by chaining them together.
This probably works fine with repl driven development(same as in lisp), you find out during development that your words cannot be composed. But as mentioned by others it may make the code hard to read, having to keep the state id the stack at all times in your head.
I was thinking just adding a light syntax, ex:
let add a b = a b +
// optional type annotation
let square a = a a *
let add-square = add square
Maybe add some type inference, support for structs, match expressions. But at the core keep the low level FORTH nature, with an interpreter and compiler.
It remains to be seen if it's possible to reach a balance here. FP programmers may be disappointed this is not a proper FP language, while FORTH programers may say it's a syntax ridden abomination.
I would say with some tooling (editor support, test framework, god forbid package manager), it can be an interesting option for embedded development.
: add {: a b :} a b + ;Which is not a bad thing. Go nuts. Just realize that there may be some degree of prior art for what you're doing.
I was planning to investigate this space just for fun. Most likely nothing will come out if it and that's ok, it's just a learning opportunity.
As someone that spent a couple of years dabbling in forth before moving on to Ruby, I became a lot more appreciative of the sheer readability of Ruby, and ruby-inspired languages like coffeescript & elixir.
However I still have a soft spot for the ethos of Chuck Moore. Abstractions are something that we should be wary of as programmers.
I feel lisp is very similar, an inverted sort of forth, I've never tried lisp but it seems to be a much easier language to work with than forth.
Not in my experience.
I even recycled "throw-away" scripts - thing that were written as "write-only" - a couple of times. I also continuously improve my dialect, so sometimes I break the utilities I've made for work. One of them has been working 24/7 for years (probably longer than your time playing with Forth), during which I have modified it to better fit my evolving needs more than a couple of times.
What influence has Forth had?
also I don't know if it's still the case but mac used openfirmware fcode/forth
- a vt100 terminal emulator
- a pacman clone
- a text editor
- a plotting utility for an HP plotter
- an interface for a Coulter counter
Probably other stuff I have forgotten now.
To extend the hype metaphor in your comment, FORTH is like the really good, really under-the-radar niche local artist that a bunch of critically-acclaimed, really hyped bands like.
8th resembles Forth about as much as Javascript resembles C. There is a superficial similarity but 8th underneath is dynamically typed, garbage collected, etc, while Forth is close to assembler. That said, 8th is cool.
In general, I kinda get what you're saying though in that JS and C share a syntax and are very different. However, 8th still is stack based and has all the hallmark Forth words like "dup", "rot", "pick"... etc that clearly mark it as part of that language family.
8th does sort of get rid of the ethos of FORTH, which is a pretty important part of a language.
I can definitely think of underground bands more popular than it and significantly more well known than it despite still being absolutely under the radar, because it only has, upper bound, ten thousand people who actually program in it. That's basically a single college radio station play's worth.
You're conflating "I read this" with "The world reads this." This is a common error. The trick is to realize that your experience with the internet is not universal, and that it is unlikely you are the average user in any group you're in.
Further, it doesn't even show up on the subreddit you mention very often; I just checked the reddit BigQuery database and FORTH posts don't collect a portion of upvotes worth mentioning in any given year.
Also: Using superfluous question marks for emphasis is a reddit habit. It should not be done on HN, because it is annoying and lowers the quality of discussion; the guidelines forbid uppercase-emphasis for this reason, and this is more egregious.
FORTH was invented in 1968, and was first used outside of Moore's lab by 1970. I could only wish one of my works was still being trash-talked on HN 53 years from now! You can't pay for that kind of "hype".