Following up with what Dwight, I want to point out one of my favorite "Forth" moments.
This is Frank Sargents "3 instruction Forth". What it really is, is a "forth slave". He's using it to bootstrap 68H11 board, and he has a "master" Forth on another machine to drive it.
The epiphany of this is where this stands out over pretty much any other high level language.
In most any other language, you as a user don't have access to the lowest level of primitives. Notably, assignment.
If you have an expression, like A = 1, many languages give you a lot of flexibility over what shows up on the right hand side, the 1 in this case. Some give you some flexibility on the left hand side, as in what A means and how it handles the 1.
But not many give you the capability to really hack in the the "=" part of the expression.
Consider.
VAR @ 1 + VAR !
This takes the VAR variable, fetches its value, add 1 to it, and stores it back. The @ and ! are the "fetch" and "store" commands. Fetch and Store are first class operations. This is routine, Forth 101.
Now consider this:
VAR X@ 1 + VAR X!
This does the identical thing. The difference is that the data motion is happening on the slave computer, the 68H11 in this case. X@ fetches the value of the memory specified on the stack (from VAR) from the 68H11, and stores it on the local, host, stack. Similarly the X! takes the 2nd item on teh stack and stores it in the address specified on the top of the stack.
This is a pretty profound bit of kit here.
Now, you can drive this 68H11, with essentially NO software on it (the driver to communicate data over the serial line is trivial), and you can use your "full boat" Forth as the monitor. You can use your editor, your mass storage, etc. Just the data is stored on the board.
Rather than having 8K of code on the new board, you have, perhaps, 100 bytes.
It's a pretty neat concept.
This is Frank Sargents "3 instruction Forth". What it really is, is a "forth slave". He's using it to bootstrap 68H11 board, and he has a "master" Forth on another machine to drive it.
The epiphany of this is where this stands out over pretty much any other high level language.
In most any other language, you as a user don't have access to the lowest level of primitives. Notably, assignment.
If you have an expression, like A = 1, many languages give you a lot of flexibility over what shows up on the right hand side, the 1 in this case. Some give you some flexibility on the left hand side, as in what A means and how it handles the 1.
But not many give you the capability to really hack in the the "=" part of the expression.
Consider.
VAR @ 1 + VAR !
This takes the VAR variable, fetches its value, add 1 to it, and stores it back. The @ and ! are the "fetch" and "store" commands. Fetch and Store are first class operations. This is routine, Forth 101.
Now consider this:
VAR X@ 1 + VAR X!
This does the identical thing. The difference is that the data motion is happening on the slave computer, the 68H11 in this case. X@ fetches the value of the memory specified on the stack (from VAR) from the 68H11, and stores it on the local, host, stack. Similarly the X! takes the 2nd item on teh stack and stores it in the address specified on the top of the stack.
This is a pretty profound bit of kit here.
Now, you can drive this 68H11, with essentially NO software on it (the driver to communicate data over the serial line is trivial), and you can use your "full boat" Forth as the monitor. You can use your editor, your mass storage, etc. Just the data is stored on the board.
Rather than having 8K of code on the new board, you have, perhaps, 100 bytes.
It's a pretty neat concept.