「‍」 Lingenic

README

(⤓.md ◇.md); γ ≜ [2026-02-12T055729.000, 2026-02-12T055729.000] ∧ |γ| = 1

CHROMA

Convert between ColorFORTH binary (.cf) and Fifth text (.fifth) formats.

Usage

tclsh chroma.tcl input.fifth output.cf
tclsh chroma.tcl input.cf output.fifth

Requirements

  • Tcl 8.5+

The .fifth Format

Fifth represents ColorFORTH's color-encoded tokens as emoji:

EmojiColorMeaning
🟥RedDefine word
🟨YellowExecute
🟩GreenCompile
WhiteNumber
🟦BlueVariable
💬CyanComment

Color persists until the next marker. Space required after each emoji.

Example

🟥 square 🟩 dup * ;
⬜ 5 🟨 square 💬 result: 25

ColorFORTH Binary Format

Each 32-bit word contains:

  • Bits 3-0: Tag (color/type)
  • Bits 31-4: Shannon-coded characters (28 bits)

Character Encoding

Variable-length Shannon codes based on frequency:

BitsCharacters
4-bit r t o e a n i
5-bits m c y l g f w
7-bitd v p b h x u q 0-9 j - k . z / ; : ! + @ * , ?

Tag Values

TagColorMeaning
0Extension (continues previous word)
1, 3YellowExecute
4RedDefine
5, 6, 7GreenCompile
8WhiteNumber
9, 10, 11CyanComment
12BlueVariable

Long Words

Words exceeding 28 bits use extension words (tag 0). The converter handles this automatically.

Examples

# Convert .fifth to ColorFORTH binary
tclsh chroma.tcl examples/square.fifth examples/square.cf

# Convert back to .fifth
tclsh chroma.tcl examples/square.cf examples/output.fifth

References

License

Apache 2.0