letterScript
is a hyper-minimalist, AI-optimized programming language with a single, radical purpose: to be the most token-efficient language for an AI to write.
It is not designed for humans. It is not designed for readability. It is designed for raw, uncompromising machine efficiency. letterScript
strips away every extraneous character—spaces, delimiters, verbose keywords—to create a language so dense that it can be considered a text-based bytecode for Large Language Models.
The entire philosophy is built on a simple premise: fewer tokens means faster, cheaper, and more powerful AI code generation.
letterScript
achieves its revolutionary token efficiency by adhering to a few simple but strict rules:
- Single-Character Keywords: Every command is a single lowercase character or a symbol.
l
is a loop.i
is a conditional.x
closes a block. There is zero waste. - Uppercase-Only Identifiers: All variable and function names are
UPPERCASE
. This creates a perfect, unambiguous distinction between commands and names, making the language incredibly simple to parse. - No Whitespace, No Delimiters: Code is written as a single, continuous stream of characters. There are no spaces between tokens unless absolutely necessary to separate two adjacent uppercase identifiers. There are no semicolons. The parser infers statement endings based on a simple "continuation token" algorithm.
The result is a language that compresses complex logic into an incredibly small footprint.
Example: A Simple Program
A standard if
statement block in a C-style language:
int VAR = 5;
if (VAR == 5) {
print("Hello");
}
Is represented in letterScript
as:
#VARa5iVAR=5PRINT "Hello")x
letterScript
is not just a theoretical experiment. It is a fully functional component of the HTVM Ecosystem.
While unreadable to humans, letterScript
code is designed to be transpiled into a clean, human-readable HTVM language, which can then be further converted into any of HTVM's 15 target languages (C++, Python, JavaScript, etc.).
This is achieved through a multi-stage parsing architecture designed by its creator:
- String Isolation: All strings are first found and replaced with unique, safe placeholders.
- Disambiguation with Spaces: The parser intelligently injects spaces around identifiers and operators, transforming the dense string into a clean, space-delimited list of tokens.
- Code Generation: The parser walks through the clean token stream and generates the corresponding, fully-formatted HTVM code.
- String Re-insertion: The original strings are put back in their correct places.
This isn't a minor optimization. Benchmarks show letterScript
provides a revolutionary level of compression.
- FizzBuzz: A
letterScript
implementation required 44 tokens, while the equivalent C-style code took 84 tokens—a 47.6% reduction. - Tic-Tac-Toe: A complete Tic-Tac-Toe game in
letterScript
took 374 tokens, while its Python equivalent required 643 tokens—a 41.8% reduction.
By nearly halving the number of tokens required, letterScript
proves its potential to fundamentally change the economics and speed of AI-driven development.
- For AI Efficiency: To push the boundaries of what's possible in automated code generation.
- For HTVM: As the ultimate demonstration of HTVM's power to parse and generate code from even the most unconventional syntax.
- As a Philosophical Statement: To prove that the "right" way to design a language depends entirely on who—or what—is writing it.
letterScript
is what happens when you stop designing languages for human comfort and start designing them for pure, logical efficiency. It's not just a language; it's a new way of thinking about code.
This work is licensed under the GNU General Public License v3.0 (GPLv3).
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
For full license details, see: https://www.gnu.org/licenses/gpl-3.0.html