Documentation
Weft 0.3.33 — language, stdlib, agents, telecom, devops.
Your app / script
↑
Optional modules telecom · mold · ml · tokensave · cache · retry ... (registry → vendor/)
↑
Stdlib (70 pkgs) llm · http · web · db · fs · sh · mcp · sysinfo ... (in the binary)
↑
Language + VM Result/? · match · enum · closures · channels (lex → parse → compile → run)
Language
Language reference
Full syntax, types, closures, enums, match, defer, Result.
Syntax cheatsheet
One-page quick reference.
Error handling
Result, ?, context, bail, ensure.
Concurrency
map/filter fan-out, spawn, channels, race, timeout.
Standard library
Stdlib reference
All 70 packages with examples.
http
json
db
fs
llm
LLM providers
OpenAI, Anthropic, Ollama, vLLM — one env switch.
llm
agents
Local LLMs
Ollama and vLLM setup for offline use.
Web & HTMX
HTTP servers, static files, SSE, forms, cookies.
CLI tools
Flags, subcommands, prompts, exit codes.
Data & SQL
SQLite, Postgres, CSV, table transforms.
DevOps & sysops
sysinfo, proc, netutil, shell, runbooks.
Charts & viz
SVG/HTML charts from data.
Agents & AI
Ecosystem map
How llm, mold, ml, tokensave, and telecom fit together.
mold — structured output
Validate LLM JSON, JSON Schema, tool params.
ml — embeddings & RAG
Vectors, cosine similarity, RAG index.
Fine-tuning
Private training, LoRA, presets, air-gapped deployment.
Tooling
Tooling guide
check, test, fmt, bench, debug, profile, lsp, mcp, notebook.
Testing
fn test_*, coverage, test runner.
Production
Timeouts, secrets, deploy checklist.
Roadmap
Where we are, where we're going, what's out of scope.
Quick reference
| Syntax | What it does |
x := 1 | Bind a value (immutable) |
mut n := 0 | Mutable binding |
fn add(a, b) { a + b } | Function (last expression returned) |
fn main -> Result { ... } | Entry point with error handling |
expr? | Propagate error (unwrap Ok or return Err) |
"hi $name" | String interpolation |
x |> f | Pipeline |
match x { 1 { "one" } _ { "other" } } | Pattern matching |
enum Status { Ok, Err } | Simple enum |
enum Shape { Circle(r) } | Sum type with payload |
map(list, fn) | Concurrent map (fan-out by default) |
spawn(fn, args...) | Run in background |
ch := channel(n) | Buffered channel |
use pkg | Import stdlib package |
use "./lib.weft" as lib | Import local file |
CLI commands
| Command | What it does |
weft run file.weft | Run a script |
weft check [--types] | Type check |
weft test [-q] | Run tests |
weft fmt [--check] | Format code |
weft debug file.weft | Debugger |
weft profile file.weft | Profiler |
weft mcp serve file.weft | MCP tool server |
weft lsp | Language server |
weft update | Self-update to latest |
weft upgrade | Upgrade packages |
weft registry install name | Install from registry |
weft publish --key name | Publish to registry |
weft gen "task" -o out.weft | Generate Weft from English |
weft doctor | Check environment |
weft stdlib [pkg] | List packages/members |