colorForth, from Forth creator Chuck Moore, is a dialect of Forth where colour of the source text is semantically important. There is no typical syntax: programs are pure sequences of words, where the colour of the word indicates its role. In broad terms:
- green words are ordinary function calls or number literals to be compiled;
- red words define functions, like
:
in standard Forth, saving the instruction address under that name; - yellow words are function calls executed at compile time;
- white words are comments to be ignored;
- magenta words declare named variables;
- cyan words are deferred macro calls.
There are no keywords, and no parsing, but the nature of every term is statically manifest. It is almost a visual language, but probably not quite, though a specialised editor is required to allow the programmer to choose the word colour while writing. You could argue the toss on that.
This approach is intriguing, but seems to be unique in modern languages, even within the space of visual languages. I'm interested in why that is.
I'd especially like to see any experience reports, case studies, or other results showing differences in programmer satisfaction, comprehension, accuracy, or speed compared to more conventional Forth text. If there are other non-colorForth systems that have taken or considered a similar approach—industrially, academically, or personally—any indications from those would also be welcome. If there is reason to believe that it is a helpful approach, just underexplored for whatever reason, that would also be useful, or the reverse; I don't want to limit things to just colorForth–Forth randomised controlled trials (though I'd love to hear about any of those!).
I recognise that colorForth is able to bypass parsing and so have complete compiler in "a dozen or so lines of code", but I am asking about the experience in the language, rather than as the implementor; it also primarily targeted a bespoke system that may have limited its own adoption, more than the paradigm's.