Skip to content

WeldA web-service language that compiles to Zig

Statically typed, then native. One toolchain dependency — the Zig compiler.

A taste

weld
type User = { id: int, name: string, email: string? }

route GET "/users/:id" (id: int) -> User {
    respond User { id: id, name: "Ada Lovelace", email: "ada@example.com" }
}
sh
$ weld app.weld --emit bin -O ReleaseFast && ./app &
$ curl localhost:8080/users/42
{"id":42,"name":"Ada Lovelace","email":"ada@example.com"}

You never write JSON: return a record or list and Weld encodes it; return a string and it is sent as text.