These simple words are easily and thoroughly tested by typing them on the command line. The Edit/Compile/Test sequence is extremely fast, boosting programmer productivity. A philosophy of early binding helps to produce efficient, reliable code.
A new word is defined by a string of previously-defined words ending with a semicolon. The only other syntax is that IF must be matched with THEN, and FOR with NEXT.
In Forth, a new word is defined by a preceeding colon, words inside a definition are compiled, outside are executed. In colorForth a new word is red, green words are compiled, yellow executed. This use of color further reduces the syntax, or punctuation, needed. It also makes explicit how the computer will interpret each word.
colorForth does not conform to the ANS Forth Standard. It is a dialect built upon the instruction set of my Forth microprocessor chips. The Pentium version implements those instructions as macros. And adds others as needed to optimize the resulting code.
With the huge RAM of modern computers, an operating system is no longer necessary, if it ever was. colorForth includes multi-tasking, and drivers for essential devices. But that is hardly an operating system in the style of Windows or Linux.
Megabytes of software may be required for historical compatibility, but sometimes we need a fresh start. ColorForth provides the necessary capability with kilobytes of code. At boot, it copies disk into RAM. Then compiles the macros that emulate the stack machine that Forth expects. As applications are requested, they are compiled.
A Forth application can take 1% the code employed by the same application written in C.
Rather than a string of 8-bit characters, colorForth interprets pre-parsed words. A word starts with 4 bits that indicate its color and function - text, number, etc. Then 28 bits of left-justified, Shannon-coded characters, averaging 5.2 bits each. Numbers are stored in binary. Each word occupies 1 or more 32-bit memory locations.
This pre-parsed source makes instantaneous compile possible. A special text Editor is included that understands this format. The source can be un-parsed into a bit string for compression and security.
Here is a sample of source code, the guts of the IDE hard-disk driver. Yes, that's all it takes. Below the line is a 'shadow block' of comments explaining the code.
And here is a paper describing arithmetic for the GreenArrays' c18 computer. Lots of functions implemented with colorForth instructions.
Blocks are numbered, some are named. They are displayed with 16x24pixel characters, arranged in a 40x24 format on a 1024x768 display. At the bottom, the contents of the Data stack, and the current word are displayed.
This display format is also used by applications. The large characters are readable and help minimize clutter. Double-size characters are available, as are graphic shapes (triangle, box, hexagon, circle), images (JPEG, GIF), 3D shapes and anything else that's been coded.
The assignment of the keys changes, with the current one displayed on-screen at lower right. It's pleasantly easy to type while referring to the display. These keys minimize finger travel, as close to Dvorak's arrangement as 27 keys permit.
They are used as function keys (menu selects) for applications. The only text that needs to be typed is when editing source code.
Other arrangements are possible. Including, gulp, standard qwerty.
Glen Haydon publishes literature about Forth. He has copies of Leo Brodie's best-selling book Starting Forth.
The Forth Interest Group organizes meetings and has literature and libraries of Forth code. They are on a Webring that links to other Forth sites.
Elizabeth Rather at Forth, Inc provides commercial-grade Forth systems and applications.
Greg Bailey has information about the ANS Forth Standard and its Technical Committee J14.