Spec
Types
num | f64 |
int | i64 |
str | string |
bool | boolean |
void | no value |
Keywords
fn | function |
ret | return |
type | type definition |
if | conditional |
let | binding |
call | function call |
ok | success |
err | error |
or | union separator |
Operators
plus | + |
minus | - |
times | * |
over | / |
mod | % |
eq | == |
neq | != |
lt gt lte gte | < > <= >= |
and or not | logical |
Positional
first | param 0 |
second | param 1 |
third | param 2 |
fourth | param 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" = val | Set value |
Compilation
NERD → Lexer → Parser → AST → LLVM IR → clang → native
View on GitHub