Documentation

Weft 0.6.2 — 83 stdlib packages, 24 registry modules, agents, telecom, devops.

Your app / script24 modules telecom · auth · router · config · warp · dataframe · mold ... (registry → vendor/)83 stdlib llm · mcp · dns · tls · os · http · db · sysinfo · crypto ... (in the binary)Language + VM Result/? · match · enum · closures · channels · auto-fetch (lex → parse → compile → run)

Get started

Language

Standard library (83 packages)

Agents & AI

Speech & ML

Telecom

Infrastructure automation

Numeric, data & ML

Browser & WASM

Registry modules (24 packages)

Infrastructure

Tooling

Quick reference

SyntaxWhat it does
x := 1Bind a value (immutable)
let mut n = 0Mutable 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 |> fPipeline
match x { 1 { "one" } _ { "other" } }Pattern matching
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 pkgImport stdlib or registry package (auto-fetch if missing)
use { "auth" "config" }Grouped imports
use "github.com/user/repo"Git import (auto-clone into vendor/)
use "./lib.weft" as libImport local file

CLI commands

CommandWhat it does
weft run [--watch]Run a script, auto-reload on change
weft build [-o myapp]Standalone executable (no weft needed on target)
weft check [--types] [--strict]Type check (CI uses --strict)
weft test [--race] [--mem] [--timeout N] [--coverage]Run tests
weft bench [--save f.json] [--compare base.json]Benchmarks with regression tracking
weft lint [path]Static analysis (unused imports, TODOs, line length)
weft fmt [--check]Format code
weft doc [path]Generate API docs from pub fn
weft infoSystem report (memory, disk, uptime, network)
weft debug [--dap]Debugger (CLI or DAP for VS Code)
weft profile file.weftExecution profiler
weft mcp serve file.weftMCP tool server
weft lspLanguage server (completion, hover, rename, diagnostics)
weft updateSelf-update with SHA-256 verification
weft upgradeUpgrade installed packages
weft outdatedCheck for newer package versions
weft get <name>Install from registry or path
weft publish --key namePublish to registry with ed25519 signing
weft gen "task" -o out.weftLLM generates Weft code
weft doctorCheck environment
weft stdlib [pkg[.member]]Browse stdlib (live probe for zero-arg functions)