LLM-native language

60-80% fewer tokens for LLM code

Sigil is an intermediate representation that transpiles to Python. Same semantics, fraction of the tokens.

Python44 tokens
import json

def safe_parse(text: str) -> dict:
    try:
        result = json.loads(text)
        return result
    except json.JSONDecodeError:
        return {}
    except TypeError:
        return {}
Sigil14 tokens
<json>

@safe_parse text:s>{} = !{json.loads text}~>{{}}
68%token reduction on this example

The problem

LLM tokens are expensive and finite

$

Token costs add up

Every token costs money. In agentic workflows that generate hundreds of functions, verbose Python burns through budgets fast.

[...]

Context windows fill fast

Code accumulates in conversation history. Python's verbosity eats context that should go to reasoning.

>_

Verbose code = wasted compute

LLMs don't need def, return, or try/except spelled out. They parse denser notation just as well.

How it works

Write dense, ship readable

Sigil is not an execution target. It compiles to clean Python.

1

Write Sigil

Token-dense notation with zero ambiguity.

@clamp x:f lo:f hi:f>f =
  x<lo ? lo : x>hi ? hi : x
2

Transpile

Tree-sitter parser, IR, Python AST. One command.

$ sigil transpile clamp.sigil
--> clamp.py
3

Run Python

Clean, idiomatic output. Zero runtime overhead.

def clamp(x: float, lo: float,
          hi: float) -> float:
    return lo if x < lo else \
      hi if x > hi else x

Benchmarks

Real numbers from real code

73%
token reduction on translatable code
61%
function coverage across real apps
45%
effective project-level savings
0
runtime overhead

Examples

Side-by-side transformations

Error handling

Python32 tokens
def safe_div(a: float, b: float) -> float:
    try:
        return a / b
    except ZeroDivisionError:
        return 0.0
Sigil11 tokens
@safe_div a:f b:f>f = !{a/b}~>{0.0}

Average

Python22 tokens
def average(ns: list[float]) -> float:
    return sum(ns) / len(ns)
Sigil7 tokens
@average [f]>f = +$/# $

Filter

Python28 tokens
def evens(ns: list[int]) -> list[int]:
    return list(filter(
        lambda x: x % 2 == 0, ns))
Sigil10 tokens
@evens ns:[i]>[i] = ns|\x->x%2==0

Try it live

Write Sigil, see Python output instantly. No install needed.

Open Playground