Forth has some interesting quirks and has a very long history of success in various fields (space travel, radio astronomy, automotive).
The two books mentioned in this thread are a great intro (Starting Forth and Thinking Forth), for some more history have a look here:
http://www.colorforth.com/HOPL.html
One way to think about Forth is a language that is so extensible that the only way to write your program is to extend it with a DSL to solve your problem.
http://git.annexia.org/?p=jonesforth.git;a=blob_plain;f=jone...
http://git.annexia.org/?p=jonesforth.git;a=blob_plain;f=jone...
Forth is a "glass box" instead of a "black box", and it's simple enough that you can easily understand EVERYTHING about how it works right down to the most primitive words defined by machine instructions. It like scheme in that it's great for meta programming and creating higher level domain specific languages, but its approach is different enough and much lower level than Scheme that it's worth learning scheme as well as forth, to contrast them for a better perspective.
Another interesting related language is PostScript, which is a lot like Forth in some ways (rpn stack based, separate return and parameter (and dictionary scope) stacks, how the threaded interpreter works, and its extreme simplicity and power) but a lot like scheme in other ways (data is code, polymorphic arrays and dictionaries, typed object references instead of raw untyped pointers, with typed objects bound to names in dictionaries as opposed to typed variables holding values (you can redefine the same name to different types, since the object with its type is associated with the key in a dict, the type is not declared for the variable name itself like C), a safe high level language with bounds checking, garbage collection (in a modern implementation -- old printers tend to use simpler heaps), etc).
PostScript (and scheme) is a lot more of a "black box" than Forth is, since there's a lot of magic stuff going on under the hood that you can't see, to make it seem simple on the surface. And I'd say that on the surface, PostScript is simpler than Forth, because of how it's higher level and you don't have to worry about a lot of details. But Forth is actually extremely simple all the way down!
\ First you should:
FORTH ?KNOW IF
HONK!
ELSE
FORTH LEARN!
THEN
\ Then you can:
BEGIN
FORTH THINK!
AGAINYou write your program by creating a dsl.
They are both 'syntax-less' in scheme you have an AST in forth you have two stacks and a dictionary of words.
As many people say about Scheme it is highly enlightening to write yout own forth interpreter.
https://github.com/JohnEarnest/Mako/tree/master/demos/Loko
I also wrote a browser based VM so you can give it a spin without compiling anything yourself:
[1] https://en.wikipedia.org/wiki/Open_Firmware
[2] https://en.wikipedia.org/wiki/Mitch_Bradley
In fact: the Open Firmware boot loader and plug-in card firmware interface technology, commonly used by both Sun and Apple, is the only firmware standard in existence to ♫ have its own theme song ♫ [3] !!!
[3] https://web.archive.org/web/20070204145613/http://playground...
: OpenFirmwareSong ( 🎸- ♬ )
\ By Mitch Bradley.
\ Sung to the tune of "The Flintstones".
𝄞
." Firmware" cr
." Open Firmware" cr
." It's the appropriate technology," cr
." Features" cr
." FCode booting" cr
." Hierarchical DevInfo tree." cr
." Hack Forth" cr
." Using Emacs on the keys," cr
." Save in" cr
." NVRAM if you please." cr
𝄒 cr
." With your" cr
." Open Firmware" cr
." You can fix the bugs in no time" cr
." Bring the kernel up in no time" cr
." We'll have an FCode time!" cr
𝄒 cr
\ Thank you and good night!
reboot
;OpenFirmware is one of the main inspirations for the design of Snabb Switch too. I was impressed that Mitch writes his own drivers faster than most people can integrate off-the-shelf ones. He sets a great example of getting more done by making a habit of self-sufficiency instead of accumulating ever more dependencies and keeping them up to date.
Relevant blog entry: http://lukego.github.io/blog/2012/10/28/firmware-vs-software...
I worked with Mitch on "bringup" of the OLPC 1.5 hardware and got to see him doing amazing things. The best was when he needed to initialize the memory controller to make RAM available and so he flashed a small Forth system that could run strictly within cache and then connected to that with a serial port and poked the memory controller registers until he had the RAM working. Made an impression on me :-).
ps: I did buy a Mac Mini with the idea that I could play with bare metal Forth.