I learned Snobol and then wrote a toy Forth

71 ingve 12 5/11/2025, 6:38:27 AM ratfactor.com ↗

Comments (12)

throwaway71271 · 2h ago
R. G. Loeliger Threaded Interpretive Languages Their Design And Implementation[1] is an amazing book, since it was out of print, I printed it on a good 160gsm a4 paper, and I randomly open it every few weeks just to read through it. I strongly recommend it, even if you are not interested in Forth.

I have been programming in all kinds of languages, from assembly to clojure, but in 25 years I never programmed stack languages, I was kind of scared of them, it wasn't until I read the book and made my own Forth I understood what I was missing. Since then I made few interpreters, with jit, or with types, etc, it was super fun, but most of all it allowed me to see a completely new paradigm of programming, kind of the first time you understand eval/apply from 13th page of the LISP 1.5 Programmer's Manual. A language that writes itself and it is written in itself.

If you are making your own Forth, this Brad Rodriguez's article is also really good [2].

[1]: https://archive.org/details/R.G.LoeligerThreadedInterpretive...

[2]: https://www.bradrodriguez.com/papers/moving1.htm

bwfan123 · 2h ago
Back in the day, iirc sun workstations booted into forth as a rommed boot-monitor for hw diagnostics. Is forth around anymore in practical use ?
Jtsummers · 1h ago
Open Firmware: https://en.wikipedia.org/wiki/Open_Firmware

OpenBOOT: https://openfirmware.info/OpenBOOT

That second link has a link to a git repository and you can see the forth code there.

packetlost · 1h ago
I recall a RedoxOS developer mentioning they were using a FORTH in the bootloader or some other very low level piece of that project.

FORTH is the type of thing that probably exists all over the place but it's so deep and arcane that you would never know it.

yjftsjthsd-h · 1h ago
Last I looked FreeBSD was using FORTH in their bootloader
throwaway71271 · 1h ago
well there is https://collapseos.org/ :)
JSR_FDED · 2h ago
I love this! SNOBOL is weird but the article does a great job showing the power of a small but very uniform and consistent language.
jollyllama · 56m ago
Upvote for Ratfactor who made the most useful HTMX reference around (even though it wasn't completed) https://ratfactor.com/htmx/
oytis · 1h ago
Are there any non-toy implementations of Forth?
haolez · 55m ago
There are probably several, but I had contact in the beginning of my career with a company that made industrial printers. They said that, in the first years of the company (80s), adopting FORTH gave them an edge over the competitors and it was the main (tech) factor of their success. They implemented their firmware in FORTH with some PostScript wizardry as well.
rwmj · 29m ago
gforth (https://www.gnu.org/software/gforth/) is non-toy, although at the same time I'm not aware of commercial products that might use it.
quasidasimagasi · 1h ago
I guess this is supposed to be some kind of trolling, nonetheless: mecrisp is great and definitively no toy.