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
| Character | Meaning | Use |
|---|---|---|
| l | Bit 0 | Represents a zero bit in the encoded body. |
| I | Bit 1 | Represents 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 field | Meaning |
|---|---|
!lI/1 | Format marker and version 1. |
N | Number of Unicode characters in the original source. |
B | Exact number of bits in the encoded body. |
F | Character-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.
| Character | Unicode | Frequency | Code length | Huffman bits | lI code |
|---|---|---|---|---|---|
| Table will appear here. | |||||
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
- Count each Unicode character in the source.
- Build a Huffman tree from the character frequencies.
- Use the tree to determine each character’s code length.
- Assign canonical Huffman codes by sorting on code length, then Unicode code point.
- Replace every
0bit withland every1bit withI. - 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
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 / symptom | Likely cause |
|---|---|
| Missing or malformed header | The first line does not match the lI v0.1 header format. |
| Bit count mismatch | The body contains more or fewer l/I symbols than the header says. |
| Invalid Huffman bit sequence | The bitstream does not match the codes reconstructed from the frequency table. |
| Decoded character count does not equal N | The recovered text length differs from the header’s character count. |
| Frequency mismatch | The 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.