Basics
Plain English
NERD uses words, not symbols. Every keyword is an English word that tokenizes as a single token in LLMs.
-- Instead of: a + b
a plus b
-- Instead of: a == b
a eq b
-- Instead of: return x
ret x
No Symbols
No curly braces. No semicolons. No parentheses. No arrows. Just words and whitespace.
-- Traditional
function add(a, b) { return a + b; }
-- NERD
fn add a b
ret a plus b
No Brackets
Function calls don't need parentheses. Arguments are space-separated.
-- Traditional
sqrt(pow(a, 2) + pow(b, 2))
-- NERD
math sqrt asq plus bsq
Newlines Matter
Each statement is on its own line. No statement terminators needed.
fn hypotenuse a b
let asq call square a
let bsq call square b
ret math sqrt asq plus bsq
Words as Operators
+ | → | plus |
- | → | minus |
* | → | times |
/ | → | over |
== | → | eq |
!= | → | neq |
< | → | lt |
> | → | gt |
&& | → | and |
|| | → | or |
! | → | not |
Words as Numbers
Small integers have word equivalents for maximum token efficiency.
if op eq zero ret ok a plus b
if op eq one ret ok a minus b
if op eq two ret ok a times b
Why This Works
LLMs tokenize common English words as single tokens. Symbols often fragment.
function→ 1 token===→ 2-3 tokensplus→ 1 token>=→ 2 tokens
Result: same logic, 50-70% fewer tokens.
Comments
-- double dash for comments
# hash works too
Next
See Spec for the full language reference.