ColorForth explained

colorForth
Paradigm:Procedural, stack-oriented
Year:1990s
Designer:Charles H. Moore
Developer:Charles H. Moore
Latest Release Version:[1]
Typing:Typeless
Influenced By:Forth
License:Public domain
Website:Archived at

colorForth is a programming language from the Forth language's creator, Charles H. Moore, developed in the 1990s. The language combines elements of Moore's earlier Forth systems and adds color as a way of indicating how words should be interpreted. Program text is tokenized as it is edited; the compiler operates on the tokenized form, so there is less work at compile time.

colorForth is an idiosyncratic programming environment: the colors simplify Forth's semantics, speed compiling, and are said to aid Moore's own poor eyesight: colorForth uses different colors in its source code (replacing some of the punctuation in standard Forth) to determine how different words are treated.

colorForth was originally developed as the scripting language for Moore's own VLSI CAD program, OKAD,[2] with which he develops custom Forth processors. As the language gained utility, he rewrote his CAD program in it, spruced up the environment, and released it to the public. It has since gained a small following, spurred much debate in the Forth community, and sprung offshoots for other processors and operating environments. The language's roots are closer to the Forth machine languages Moore develops for his processors than to the mainstream standardized Forths in more widespread use.

The language comes with its own tiny (63 KB) operating system. Practically everything is stored as source code and compiled when needed. The current colorForth environment is limited to running on Pentium-grade PCs with limited support for lowest-common-denominator motherboards, AGP video, disk, and network hardware.

Coloring in colorForth has semantic meaning. Red words start a definition, and green words are compiled into the current definition. Thus,

colorForth would be written in standard Forth as : color forth ;

Yellow words are executed. The transition from green to yellow and back again can be used while defining words, to transition between compiling words into the current definition, executing words immediately (manipulating the data stack during compilation), and back again (adding the top of the data stack to the current definition) in other words, precomputing a value during compilation (a functionality that other languages use macros or optimizing compilers for).[3]

Moore developed Forth in the early 1970s and created a series of implementations of the language. In the 1980s he diverged from the standardization of the language, instead continuing to evolve it. He developed a series of Forth-like languages, each extreme in its simplicity: Machine Forth, OKAD, and colorForth.

Moore has stated that color is only one option for displaying the language. One of Moore's papers on colorForth was printed in black and white but used italics and other typographical conventions to present source code.

External links

Notes and References

  1. Web site: colorForth Status . September 2002 . https://web.archive.org/web/20160310135832/http://colorforth.com/status.html . 2016-03-10 . dead .
  2. Web site: OKAD II (Oh CAD Two). 2001-07-01. 2017-06-08.
  3. Web site: PreParsed Word Format . colorforth.com . December 2001 . https://web.archive.org/web/20110906081208/http://www.colorforth.com/parsed.html . 2011-09-06 . dead .