Spec

Types

numf64
inti64
strstring
boolboolean
voidno value

Keywords

fnfunction
retreturn
typetype definition
ifconditional
letbinding
callfunction call
oksuccess
errerror
orunion separator

Operators

plus+
minus-
times*
over/
mod%
eq==
neq!=
lt gt lte gte< > <= >=
and or notlogical

Positional

firstparam 0
secondparam 1
thirdparam 2
fourthparam 3

Numbers

zero one two three four five six seven eight nine ten

Syntax

Function

fn name params...
body

Return

ret value
ret ok value
ret err value

Type

type name fields...
type name ok type or err type

Conditional

if condition statement

Binding

let name value

Call

call function args...

Examples

Math

fn add a b
ret a plus b

fn sub a b
ret a minus b

Calculator

type result ok num or err str

fn calc a b op
if op eq zero ret ok a plus b
if op eq one ret ok a minus b
ret err "unknown"

Function Calls

fn square x
ret x times x

fn hypotenuse a b
let asq call square a
let bsq call square b
ret math sqrt asq plus bsq

Comments

-- this is a comment
# this too

Modules

MCP (Model Context Protocol)

Three primitives: Tools (actions), Resources (data), Prompts (templates).

mcp tools "url"List available tools
mcp use "url" "tool" "args"Use a tool
mcp resources "url"List available resources
mcp read "url" "uri"Read a resource
mcp prompts "url"List available prompts
mcp prompt "url" "name" "args"Get a prompt template
mcp init "url"Initialize session
mcp log "url" "level"Set log level

HTTP

http get "url"GET request
http post "url" "body"POST request
http put "url" "body"PUT request
http delete "url"DELETE request
http patch "url" "body"PATCH request
... auth bearer "token"Bearer auth
... auth basic "u" "p"Basic auth

LLM

llm claude "prompt"Call Claude API

JSON

let x {}Create empty object
obj."path"Access value
obj?"key"Check if key exists
obj."key" = valSet value

Compilation

NERD → Lexer → Parser → AST → LLVM IR → clang → native

View on GitHub