ColorFORTH evolved
Fifth is ColorFORTH evolved. Chuck Moore's minimalist language, running on any platform, with optional verification.
Fifth is dedicated to Charles H. "Chuck" Moore, creator of Forth (1970) and ColorFORTH (2001).
Chuck's work powers spacecraft, boot firmware, and countless embedded systems. His philosophy — simplicity, directness, minimal abstraction — inspired generations.
Fifth continues the lineage. ColorFORTH semantics, modern platforms, optional verification.
| ColorFORTH | Fifth |
|---|---|
| x86 only | Any GNAT target |
| No verification | Optional verification |
| Binary format | Optional text-based source |
The minimalism stays.
Fifth compiles to SPARK, then to native machine code via GNAT. This gives you:
Fifth accepts ColorFORTH binary (.cf) or text (.fifth) format.
ColorFORTH encodes token type as color. The .fifth format represents these colors as emoji squares (no cyan square exists, so comments use 💬):
🟥 square 🟩 dup * ; ⬜ 5 🟨 square 💬 result: 25
Space after each color marker. Color persists until the next marker.
| Emoji | Color | Meaning |
|---|---|---|
| 🟥 | Red | Define word |
| 🟨 | Yellow | Execute |
| 🟩 | Green | Compile |
| ⬜ | White | Number |
| 🟦 | Blue | Variable |
| 💬 | Cyan | Comment |
This is ColorFORTH in Unicode — same semantics, text-serialized.
Add annotations as comments. Ignored by default, used when verification is requested:
🟥 square 💬 ( n -- n*n ) 🟩 dup * ;
This generates SPARK contracts. GNATprove verifies them. If it compiles with verification, your stack effects are proven correct.
The full ColorFORTH word set:
| Category | Words |
|---|---|
| Stack | dup drop swap over nip push pop a a! |
| Arithmetic | + - * */ /mod negate 2* 2/ +* abs min max |
| Logic | and or xor not |
| Comparison | < u< 0< = -if |
| Memory | @ ! +! c@ c! @+ !+ |
| Control | if -if then ; for next i begin while until jump execute |
| I/O | emit key . h. cr space type |
| Hardware | in out @p !p |
Via GNAT:
Space is a separate project — a new language with universes, disciplines, and warps. Fifth is ColorFORTH preserved and modernized. Different goals, shared infrastructure.
In 1970, Chuck Moore wanted to call his language "Fourth" — a fourth-generation language. The IBM 1130 limited filenames to five characters. "FORTH" it became.
Fifth continues the lineage: Forth → Fourth → Fifth.