Compiled, self-hosted, no garbage collector. One thread per core, faults you cannot ignore, request memory the compiler proves never leaks. Written to be written by machines, read by people.
package main
import "anvil"
import "argo"
type Message struct {
text str max 200
}
fn hello(q anvil.Req, w mut anvil.Out) ! {
let reply = try within 200ms {
try greet(q.PathParam("name"))
}
w.Json()
argo.Put(mut w.Body, Message{text: reply})
}
fn main() ! {
let r = anvil.NewRouter()
r.Get(`/hello/{name}`, hello)
try r.Serve(":8080")
}Every 5xx is recorded with the answers it got from Redis, the clock and the upstreams. Run it again on your laptop, against the fix, with none of them running. Then keep it as a test.
let · mut · unitsNumbers, 200ms and 64kb, interpolated strings, names that stay and names that change.
struct · enum · ?TSized numbers, immutable strings, reference containers, enums read by match, nothing nil by accident.
fn · mut · [T]Read-only parameters, call-site mut, methods, closures, monomorphized generics.
for · matchOne loop with four shapes; match over values, ranges, enums and faults.
!T · try · catchFaults are values that must be handled. wrap keeps the cause, guard turns a panic into one.
keep · arenaRequest pools wiped per response; keep copies what must live on; the compiler checks it.
within · scope · selectTasks inside boundaries; deadlines, budgets and cancellation flow down, never up.
with · use · onRetry and trace as library policies; resources bound to scopes; typed lifecycle events.
anvil · argoRouter, per-core database, deadline, JSON: the constructs together in forty lines.