GitHub - Nerd-Lang/nerd-lang-core: Introducing NERD - the first intermediate language designed for machine authorship

6 min read Original article ↗

🚧 Early days. This is a first step toward LLM-native programming - a language machines write, humans audit. Now focusing on agent-first capabilities: LLM calls, MCP tools, thin orchestration. Lots of unknowns ahead. Not ready for real use yet. Ideas and contributions very welcome.

If you're into agents without frameworks, or you miss the days of writing C and assembly - this might be a fun playground.

NERD

No Effort Required, Done

A language built for LLMs, not for human authorship.


The Paradigm Shift

40% of code is now written by LLMs. That number is growing.

So why are we still optimizing languages for human authors?

Every public static void main, every descriptive variable name, every carefully formatted brace — all designed for humans to read and write. But humans aren't writing anymore. And increasingly, they're not reading line-by-line either.

NERD is not built for humans. It's built for LLMs.

  • Machines write it — humans never touch the source
  • Machines read it — compiles to native code via LLVM
  • Humans observe it — auditable, transparent, but not editable
  • 50-70% fewer tokens — same logic, fraction of the cost

Why "NERD"?

No Effort Required, Done.

An intermediate language. Dense. Non-human. Observable but not writable by humans. Like assembly, but for the LLM era.

What Makes NERD Different

Traditional languages use symbols that fragment into many LLM tokens:

function add(a, b) { return a + b; }

NERD uses English words - each word = 1 token:

No symbols. No braces. No semicolons. Just words.

Examples

FizzBuzz — the classic test, dense but readable:

fn fizzbuzz n
repeat n times as i
  if i mod 15 eq zero out "FizzBuzz" else if i mod three eq zero out "Fizz" else if i mod five eq zero out "Buzz" else out i
done

fn main
call fizzbuzz 15

Factorial — loops and counters:

fn factorial n
let result one
let x n
while x gt one
  let result result times x
  dec x
done
ret result

Math operations:

fn add a b
ret a plus b

fn abs x
if x lt zero ret neg x else ret x

Token Efficiency

Language FizzBuzz Math (4 fn) Savings
NERD 49 32 -
JavaScript 99 70 50-54%
Python 73 47 32-33%
TypeScript 126 96 61-67%

Quick Start (macOS Apple Silicon)

# Download and extract
curl -L https://github.com/Nerd-Lang/nerd-lang-core/releases/latest/download/nerd-darwin-arm64.tar.gz | tar -xz
cd nerd-darwin-arm64

# Write a program
echo 'out "Hello from NERD"
out five plus three' > hello.nerd

# Run it
./nerd run hello.nerd
# Output:
# Hello from NERD
# 8

# Optional: Add to PATH for global access
sudo mv ../nerd-darwin-arm64 /usr/local/nerd
echo 'export PATH="$PATH:/usr/local/nerd"' >> ~/.zshrc

The release includes all runtime libraries for HTTP, JSON, MCP, and LLM features.

Build from Source

git clone https://github.com/Nerd-Lang/nerd-lang-core.git
cd nerd-lang-core/bootstrap
make
./nerd --version

Requires: C compiler and clang (xcode-select --install on macOS)

Run the Examples

cd bootstrap

# FizzBuzz
./nerd compile ../examples/fizzbuzz.nerd -o fizzbuzz.ll
clang -O2 fizzbuzz.ll -o fizzbuzz
./fizzbuzz

# Factorial with loops
./nerd compile ../examples/loops.nerd -o loops.ll
clang -O2 loops.ll -o loops
./loops

Language Features

Feature Syntax Status
Functions fn name args... ret value ✓ Done
Variables let x value ✓ Done
Math plus minus times over mod ✓ Done
Comparison eq ne gt lt ge le ✓ Done
Output out value ✓ Done
Conditionals if cond stmt else stmt ✓ Done
Loops repeat n times as i ... done ✓ Done
While while cond ... done ✓ Done
Negation neg x ✓ Done
Counters inc x / dec x ✓ Done
Stdlib math sqrt/pow/sin/cos/... ✓ Done

Agent Capabilities

Feature Syntax Status
HTTP GET http get "url" ✓ Done
HTTP POST http post "url" "body" ✓ Done
HTTP PUT http put "url" "body" ✓ Done
HTTP DELETE http delete "url" ✓ Done
HTTP PATCH http patch "url" "body" ✓ Done
Custom Headers http get "url" with "Header" "Value" ✓ Done
Bearer Auth http get "url" auth bearer "token" ✓ Done
Basic Auth http get "url" auth basic "user" "pass" ✓ Done
LLM (Claude) llm claude "prompt" ✓ Done
MCP Tools mcp tools "url" ✓ Done
MCP Use mcp use "url" "tool" "args" ✓ Done
MCP Resources mcp resources "url" ✓ Done
MCP Read mcp read "url" "uri" ✓ Done
MCP Prompts mcp prompts "url" ✓ Done
MCP Prompt mcp prompt "url" "name" "args" ✓ Done
MCP Init mcp init "url" ✓ Done
MCP Log mcp log "url" "level" ✓ Done
.env support Auto-loads ANTHROPIC_API_KEY ✓ Done
JSON Access obj."path", obj?"key" ✓ Done
JSON Create let x {}, x."key" = val ✓ Done
OAuth 2.1 For MCP server authentication Coming next
Streaming SSE for real-time responses Coming next

Example agent:

-- Agent in NERD

llm claude "What is Cloudflare Workers? One sentence."

HTTP with Bearer Auth (OAuth):

-- Authenticated API call
http get "https://api.example.com/data" auth bearer "token123"

JSON from HTTP:

-- Fetch and access JSON
let user http get "https://api.github.com/users/octocat"
out user."login"
out user."followers"

Run with: ./nerd run agent.nerd

Basic HTTP and LLM scaffolding to experiment with — far from production-ready, but enough to see where this could go. Lots more to build. Contributions welcome.

See LLM-Native Language Going Agent-First for why we're prioritizing agent capabilities.

How It Works

┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  NERD Code  │────>│   C Lexer   │────>│  C Parser   │────>│  LLVM IR    │
│  (.nerd)    │     │             │     │   (AST)     │     │  (.ll)      │
└─────────────┘     └─────────────┘     └─────────────┘     └─────────────┘
                                                                   │
                                                                   v
                                                            ┌─────────────┐
                                                            │   clang     │
                                                            │  (native)   │
                                                            └─────────────┘
  1. Lexer - Tokenizes English words into token stream
  2. Parser - Builds Abstract Syntax Tree from tokens
  3. Codegen - Generates LLVM IR from AST
  4. LLVM/Clang - Compiles IR to native binary

Documentation

The Philosophy

"When machines write the code, why optimize for humans?"

Traditional languages exist because humans needed to read and write them. Verbose syntax, descriptive names, careful formatting — all for human comprehension.

But if 40% of code is machine-written today, and that's growing — the verbosity is pure waste. Every token costs money. Every character takes time.

NERD flips the model:

  • Not for human authorship — dense, terse, machine-optimized
  • Human-observable — you can audit it, understand it, verify it
  • Not human-editable — you describe changes in natural language, machines update the NERD

The result? Same logic. 50-70% fewer tokens. Faster generation. Lower cost.

Built like Rust was built — from scratch. Pure native compilation.

No Effort Required, Done.

Community

NERD was founded by Guru Sattanathan and is actively looking for community contributions.

This is an early-stage project exploring what programming languages look like when AI writes most of the code. Whether you're into compiler development, language design, or just curious about the future of coding — we'd love to have you involved.

Get Involved:

  • ⭐ Star this repo to follow along
  • 🐛 Open an issue if you find bugs or have ideas
  • 🔧 Check out CONTRIBUTING.md to start contributing
  • 💬 Connect with Guru on LinkedIn to join the conversation

License

Apache 2.0 — See LICENSE for details.