MikuLang v1.0.0
A terminal-native language for MikuOS. Lexical scoping, closures, async/await, pattern matching, and 60+ stdlib functions — built for mesh networks and local inference. Zero dependencies. Zero config.
Why MikuLang
MikuLang is purpose-built for the ICQ console — auto-detected, no prefix needed. It talks to your mesh, queries your models, and manages your infra without leaving the terminal.
No imports, no package managers, no build step. Type MikuLang directly into the ICQ console. Auto-detected — just start typing.
Query mesh nodes, route inference, fetch releases — all from the language. Functions like mesh.status(), mesh.peers(), and release.list() are built in.
Functions capture their enclosing scope. Nested functions, closures, first-class functions — the semantics you expect from a real language.
Network calls, model inference, file I/O — all async-capable. Use await to block only when you need to.
JSON parsing, base64, crypto hashing, HTTP requests, array manipulation, regex, datetime — all available without imports.
Multi-case pattern matching with guards and destructuring. Clean control flow for complex branching logic.
Syntax
C-style syntax with a few MikuLang-isms. String interpolation with braces, pipe operator, and clean function declarations.
# Variables & string interpolation let name = "SysOp" let releases = release.list() print "{name} has {len(releases)} releases" # Functions with lexical scoping fn filterLive(items) { return items | filter(fn(r) { r.status == "live" }) } # Async mesh query let status = await mesh.status() print "Nodes online: {status.online}" # Pattern matching match status.role { "operator" → print "Running inference" "relay" → print "Forwarding traffic" _ → print "Idle" } # Pipelines let top = releases | filter(fn(r) { r.plays > 1000 }) | sortBy("plays") | take(5)
Stdlib
len(arr) — length
push(arr, item) — append
filter(arr, fn) — keep matches
map(arr, fn) — transform
reduce(arr, fn, acc) — fold
sortBy(arr, key) — sort
uniq(arr) — deduplicate
keys(obj) — object keys
values(obj) — object values
merge(a, b) — shallow merge
has(obj, key) — key exists
upper(s) — uppercase
lower(s) — lowercase
trim(s) — strip whitespace
split(s, delim) — to array
join(arr, delim) — to string
replace(s, a, b) — substitution
md5(s) — hash
sha256(s) — hash
base64(s) — encode
base64dec(s) — decode
uuid() — random UUID
mesh.status() — node status
mesh.peers() — list peers
mesh.ping(host) — latency check
http.get(url) — GET request
http.post(url, d) — POST
release.list() — all releases
release.get(id) — single release
infer(model, prompt) — local LLM
ollama.list() — available models
abs(n) — absolute
min(a, b) — minimum
max(a, b) — maximum
floor(n) — round down
ceil(n) — round up
random() — 0 to 1
range(a, b) — sequence
json.parse(s) — parse JSON
json.stringify(o) — to JSON
typeof(v) — type name
now() — epoch ms
Terminal-native. Mesh-aware. Zero dependencies.