Open Source

Less tokens.
Same meaning.

NXL is a programming language that reduces LLM token consumption by 70%.
Built for agents, memory systems, and anyone shipping AI.

curl -fsSL https://nexus-prime.cfd/nxl/install.sh | sh
70% Token reduction
95%+ Semantic equivalence
5 Techniques combined
<10ms Compilation time

Before and after.

The same logic. A fraction of the tokens.

Python ~856 tokens
class Agent:
    def __init__(self, id, role, capabilities):
        self.id = id
        self.role = role
        self.capabilities = capabilities

    def execute(self, task):
        if task['priority'] > 5:
            result = self.execute_immediate(task)
            self.log_execution(task, 'high_priority')
        else:
            result = self.enqueue_task(task)
            self.log_execution(task, 'normal')
        return result

    def hire_subagent(self, role, budget=500):
        return agent_spawn(role=role, max_cost=budget)

    def query_memory(self, query, k=10):
        return memory_search(query=query, limit=k)

tasks = [t for t in all_tasks
    if t.status == 'ready'
    and not t.blocked
    and t.priority > 5]

result = store(transform(validate(retrieve())))

agents = [
    {"id": "agt-001", "status": "active", "tasks": 12},
    {"id": "agt-002", "status": "idle", "tasks": 0},
    {"id": "agt-003", "status": "busy", "tasks": 8},
]
NXL ~355 tokens
Agent{id,role,capabilities}{
  execute(task:Task): ...
  hire_subagent(role:str, budget:int): ...
  query_memory(query:str, k:int): ...
}

tasks  select (ready)  ¬(blocked)  priority>5

retrieve  validate  transform  store

mem?[query, recent=10, threshold=0.7]
hire![researcher, budget=500]

agents[3]{id,status,tasks}:
agt-001,active,12
agt-002,idle,0
agt-003,busy,8

Five techniques. One language.

Each technique is proven independently. NXL combines them all.

MetaGlyph Symbols

Mathematical symbols LLMs already understand from training data. ∈ ⇒ ∩ ¬ ∘ replace verbose keywords. Every symbol has an ASCII fallback.

60% reduction on control flow
{}

TOON Format

Token-Oriented Object Notation. Declare schema once, send only values. Eliminates repeated keys, quotes, and braces from structured data.

57% reduction on data
...

AST Folding

Collapse method implementations to signatures. Show structure without body. Unfold on demand when the agent needs implementation details.

80% reduction on code defs
?!

Domain Shorthand

Pattern-based abbreviations for common operations. mem?[] for search, hire![] for agents, exec@[] for execution. Extensible via config.

70% reduction on API calls
BPE

Custom Tokenizer

BPE vocabulary trained on agent orchestration patterns. Common terms like "agent" and "memory" become single tokens instead of subword fragments.

15-25% additional reduction

Get started in one line.

Install

curl -fsSL https://nexus-prime.cfd/nxl/install.sh | sh

Or clone manually:

git clone https://github.com/sir-ad/NXL.git && cd NXL && pnpm install

Compile

nxl compile file.nxl --target python
nxl compile file.nxl --target js

REPL

nxl repl

Type NXL, see compiled output instantly.

Compare tokens

nxl tokens file.nxl --compare original.py

Syntax at a glance.

Pipeline

tasks  select (ready)  ¬(blocked)

Conditional

priority>5  exec:immediate | log:high

Composition

retrieve  validate  transform  store

Shorthand

mem?[query, recent=10]
hire![role, budget=500]
exec@[mode=parallel, timeout=30s]

TOON Data

agents[3]{id,status,tasks}:
agt-001,active,12
agt-002,idle,0
agt-003,busy,8

AST Folding

Agent{id,role}{
  init(config:Config): ...
  execute(task:Task): ...
}

Symbol reference.

SymbolASCIIMeaningExample
->Pipeline / transformtasks → select ∈(ready)
Membership∈(active)
=>Implies / conditionalx>5 ⇒ action:run
&&Intersection∈(ready) ∩ ¬(blocked)
¬!Negation¬(blocked)
|>Compositionvalidate ∘ transform ∘ store
...Folded bodyexecute(task:Task): ...