This is made by the company the inventor of the language created. Then he left it because Forth, inc. needed the language to be standardized, which wasn't his idea of Forth and, his point of view is that he solved the software problems and what was left was solving the hardware problems, so he moved to working on stack-based processors.
Swift Forth is literally a professional Forth and is well regarded. The other often recommend Forth is the FOSS GForth. They are good for starting because they are popular and standard, so you'll find help easily.
Other "smaller" Forth are often non-standard dialects and are more-or-less mature experiments.
I had the same feeling, so I began to read https://www.forth.com/starting-forth/1-forth-stacks-dictiona... with gforth installed with apt. And made few exercises to manipulate the stack with some words and get a grasp on it. Now I saw how it works, I came back to my imperative languages and won't come back to it.
IMO my skills in forth are not really enough to see the distinction between any implementation of forth, so the first one I stumbled upon was ok.
Gforth is free and well rounded so I'd recommend that if you want to experiment with Forth. It is not very fast though, SwiftForth with optimised subroutine threading will be a lot faster. I haven't tried SwiftForth though as you have to pay for it and it is x86 only.
if you are working with specific hardware (e.g. microcontrollers) it depends on which forth dialects are available but for the raspberry pico and pico 2 I recently found zeptoforth [1]
The cost is stupidly high, though. Look at the source code of [1].
The only good page to take from OOP book is the automatic and implicit pseudo-variable "self" or "this", that can reduce stack juggling significantly. I've implemented that in my (yet to be published) dialect and it works like a charm. In my experience, you can have that for cheap and anything more is not worth it from the point of view of a byte-counting Forth programmer.
Yeah, I didn’t mean far out as in good. Some people would say that the important thing to take from OOP is message passing. Which I assume is a no go in Fort? Regardless of dialect.
In communication protocols, you typically send a symbol which tells the receiver the meaning and the syntax of the message, and then the data attached to the message.
In technical terms, messages belong to different application protocol data units ("APDU"). The receiver typically uses the APDU symbol (which can be just e.g. a byte) to dispatch the message internally to the right processing routine.
Message passing in OOP is the same thing, and it's ultimately about late binding. Late binding has, indeed, as much presence as dynamic typing in Forth, contrary to other scripting languages like Lisp or Lua where they are cornerstones, so to speak. Forth is firmly in the early binding camp, to the point that it does even know forward declarations [1]. Forth programmers won't do anything unnecessary, and so they expect their system won't do anything they don't need.
[1] Many scripting languages realized that skipping declarations to be "user-friendly" was a big design mistake and eventually implemented some sort of "strict" mode that became the de facto default. So they have two language features that cancel each other...
Thanks for the explanation! As you can tell, I'm very ignorant of Forth.
But I'm not sure I quite follow what you're saying. Forth has early binding, explicit forward declarations, and message passing but not in the usual OOP late binding sense. Is that right?
You're welcome. Actually, Forth doesn't have forward declarations as a "direct" feature, but it has what I would call "function values", which can be used like functions and changed almost like variables [1]. This is used for all kind of things, including forward declarations because otherwise some recursive algorithms would be very painful to write if not impossible. It's still not ideal because it is an unnecessary indirection.
It could have message passing by doing what I described earlier, like you would do in C by having a switch-case function that dispatches messages to dedicated routines. It would even be easier because there's no type checking, and more specifically no function signatures.
That's something one could do in specific cases where it is advantageous, but otherwise I would say it is "anti-idiomatic" for Forth. In particular, although Forth has no problem with variadic functions and multiple returns, including variable number of results [2], it is discouraged.
Forth is generally trying hard to push things from run-time to compile-time, and Chuck Moore was very pleased to find a way to push things from compile-time to edit-time with ColorForth [3]: the user, by switching the colors of tokens, tells the system what it should do with it: compile it, or execute it right now, or do nothing because it is comment.
This one for example looks like well rounded and user friendly option.
Would anyone care to comment about this?