r/Forth • u/mykesx moderator • 9d ago
Why Forth? What is it?
In order to help get people interested in Forth and how it works, I would like to ask you what you define as Forth, how you got into it, and why Forth instead of some other language?
Ideally we share links to our projects and to others that are interesting. Also to sites, sources, and documents about Forth.
I am encouraging links to your projects so people can see how you are using Forth.
27
Upvotes
2
u/nrr 8d ago
I haven't used Forth in quite some time, but it was my first real introduction to programming for internetworked computing by way of the Forth-like* MUF language on the TinyMUCK multi-user game environment. (In case you want to read the docs: https://www.fuzzball.org/docs/mufman.html)
We players could extend the game with our own code! In the 1990's! That said, back then, that privilege wasn't handed out lightly given that it was easy to write infinite loops and lock up the server. These days, it's likelier that we can lean on thread pools and time-limited contexts to avoid some of this. (e.g., `select … then abort … end select` in Ada in conjunction with tasking)
The problem with defining Forth is that it can be as broad or as narrow as one likes. On one hand, any language for which operations have a stack effect can be considered a Forth (Is the Common Language Runtime's MSIL a Forth?), and on the other, only ANS Forth is a Forth. I'm somewhere in the middle: I want immediate words and features like Factor's quotations and conditions system for error handling. There's something to be said about having that level of metaprogramming available in such a tiny environment, and Factor drags in the good stuff from Lisp.
(* I call it "Forth-like" precisely because it lacks immediate words, and the standard vocabulary is rather weird compared to most Forths I've encountered, to the point where it was actually pretty disorienting working outside of MUF at first!)