Open Source
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
The same logic. A fraction of the 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},
]
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
Each technique is proven independently. NXL combines them all.
Mathematical symbols LLMs already understand from training data. ∈ ⇒ ∩ ¬ ∘ replace verbose keywords. Every symbol has an ASCII fallback.
Token-Oriented Object Notation. Declare schema once, send only values. Eliminates repeated keys, quotes, and braces from structured data.
57% reduction on dataCollapse method implementations to signatures. Show structure without body. Unfold on demand when the agent needs implementation details.
80% reduction on code defsPattern-based abbreviations for common operations. mem?[] for search, hire![] for agents, exec@[] for execution. Extensible via config.
BPE vocabulary trained on agent orchestration patterns. Common terms like "agent" and "memory" become single tokens instead of subword fragments.
15-25% additional reductioncurl -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
nxl compile file.nxl --target python
nxl compile file.nxl --target js
nxl repl
Type NXL, see compiled output instantly.
nxl tokens file.nxl --compare original.py
tasks → select ∈(ready) ∩ ¬(blocked)
priority>5 ⇒ exec:immediate | log:high
retrieve ∘ validate ∘ transform ∘ store
mem?[query, recent=10]
hire![role, budget=500]
exec@[mode=parallel, timeout=30s]
agents[3]{id,status,tasks}:
agt-001,active,12
agt-002,idle,0
agt-003,busy,8
Agent{id,role}{
init(config:Config): ...
execute(task:Task): ...
}
->Pipeline / transformtasks → select ∈(ready)∈(active)=>Implies / conditionalx>5 ⇒ action:run&&Intersection∈(ready) ∩ ¬(blocked)!Negation¬(blocked)|>Compositionvalidate ∘ transform ∘ storeexecute(task:Task): ...