Documentation

Weft 0.3.33 — language, stdlib, agents, telecom, devops.

Your app / scriptOptional 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)

Get started

Language

Standard library

Agents & AI

Telecom

Packages & modules

Tooling

Quick reference

SyntaxWhat it does
x := 1Bind a value (immutable)
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 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 pkgImport stdlib package
use "./lib.weft" as libImport local file

CLI commands

CommandWhat it does
weft run file.weftRun a script
weft check [--types]Type check
weft test [-q]Run tests
weft fmt [--check]Format code
weft debug file.weftDebugger
weft profile file.weftProfiler
weft mcp serve file.weftMCP tool server
weft lspLanguage server
weft updateSelf-update to latest
weft upgradeUpgrade packages
weft registry install nameInstall from registry
weft publish --key namePublish to registry
weft gen "task" -o out.weftGenerate Weft from English
weft doctorCheck environment
weft stdlib [pkg]List packages/members