lI/ codebookQUICK REFERENCE · v0.1
Reference / cheat sheet

The lI codebook

A quick reference to the format used by lI Playground. This describes the actual v0.1 encoder and decoder: source text is compressed into a canonical Huffman bitstream represented with l and I.

1. The two symbols

CharacterMeaningUse
lBit 0Represents a zero bit in the encoded body.
IBit 1Represents a one bit in the encoded body.

The symbols encode Huffman bits; they are not individual commands or instructions. A character’s code can be more than one bit long.

2. Document structure

An lI document has a metadata header on the first line, then a newline, then the encoded body.

(!lI/1;N=...;B=...;F=...)
lIlIIllIIl...
Header fieldMeaning
!lI/1Format marker and version 1.
NNumber of Unicode characters in the original source.
BExact number of bits in the encoded body.
FCharacter-frequency table, written as Unicode code points and counts.

For example, F=U+0041:3,U+0062:1 means the source contains three A characters and one b. Entries are sorted by Unicode code point. F=- represents an empty source.

3. Full Huffman table

This is the complete table generated by the same canonical Huffman algorithm as the IDE, not a small made-up example. It starts with the IDE's default JavaScript. Change the source below to generate the full table for your own code.

Generating table…
CharacterUnicodeFrequencyCode lengthHuffman bitslI code
Table will appear here.
How to read it: every row is one unique character in the source. 0 becomes lowercase l, and 1 becomes uppercase I. The codes are based on the complete source text, so changing the source can change the whole table.

4. How encoding works

  1. Count each Unicode character in the source.
  2. Build a Huffman tree from the character frequencies.
  3. Use the tree to determine each character’s code length.
  4. Assign canonical Huffman codes by sorting on code length, then Unicode code point.
  5. Replace every 0 bit with l and every 1 bit with I.
  6. Write the header and encoded body to the output.

Because code lengths depend on the whole source, the same character may receive a different code in a different document.

5. Notes and whitespace

The decoder reads the first line as the header. In the body, whitespace and characters other than l and I are ignored. Parenthesized notes are also skipped.

(a note for humans)
lIlI lIIll
extra body notes can be added here
Important: Notes are only for readability. The decoder still checks the exact bit count against B; accidentally adding an l or I inside a note can affect the stream if the note is not properly enclosed.

6. Quick troubleshooting

Message / symptomLikely cause
Missing or malformed headerThe first line does not match the lI v0.1 header format.
Bit count mismatchThe body contains more or fewer l/I symbols than the header says.
Invalid Huffman bit sequenceThe bitstream does not match the codes reconstructed from the frequency table.
Decoded character count does not equal NThe recovered text length differs from the header’s character count.
Frequency mismatchThe decoded text does not match the character counts recorded in the header.

7. What lI is (for now)

The current playground is an encoding experiment rather than a full language runtime. You can encode JavaScript source into lI, decode it back, and run the JavaScript in the separate JavaScript pane. The lI pane itself is not directly executed as a program.