zigttp
v0.1.0-beta: proof-first TypeScript handlers
zigts subset - proven live reload - contract-aware local deploy
v0.1.0-beta turns the subset into a live proof loop
Install once. Edit your handler. Run
zigttp dev --watch --prove and watch the proof chips
flip on every save. Ship only what the verifier and contract diff
both keep green.
Linux and macOS builds keep the first run short and start from a binary, not a toolchain.
zigttp dev --watch --prove re-verifies on every
save and hot-swaps only on safe /
safe_with_additions, blocking breaking diffs in
place.
zigttp expert writes only inside zigts, reruns
the verifier, satisfies every guarantee enforced by default,
and persists every counterexample to the witness corpus.
The subset is what makes proof tractable
Your handler code is the spec.
No back-edges, no exceptions, no hidden I/O. The compiler walks
every path in finite time, enforces every guarantee by default
(narrow with Spec<...> when you need only a
few), and emits a behavioral contract small enough to diff
between versions.
TypeScript, narrowed until it can be proved
Unsupported features fail at parse time with a suggested alternative, not after deploy.
Stacked proofs: paths, sound mode, contract, guarantees by default
$ zigts check handler.ts --json --contract
→ PROVEN 7/7 paths + Spec<idempotent, deterministic>
✓
Automatic least-privilege sandboxing
The compiler extracts a contract of what the handler does - then restricts runtime access to exactly those proven values.
{
"env": ["API_KEY", "DB_URL"],
"egress": ["api.stripe.com"],
"cache": ["sessions"],
"sql": ["getUserById"],
"properties": {
"read_only": true,
"retry_safe": true
},
"proof": "complete"
}
Linear code. Parallel I/O. Crash recovery.
parallel() and race() from zigttp:io
Handler code stays synchronous and linear. Concurrency happens in the I/O layer using OS threads.
3 API calls × 50ms each = ~50ms total
--durable <dir> enables crash recovery
Write-ahead oplog. Each I/O call persisted before returning. On crash, replay without touching the network.
sleep() - sleepUntil() - waitSignal()
Ship with confidence - prove before deploy
Record every I/O boundary with --trace. Replay against new versions. Handlers = pure functions of (Request, VirtualModuleResponses).
--trace / --replay
Diff behavioral contracts and replay traces between handler
versions. Verdicts are safe,
safe_with_additions, breaking, or
needs_review - with a proof certificate.
zigts prove old.json new.json
Every successful deploy and proven hot-swap appends one row to
.zigttp/proofs.jsonl with verdicts, proven facts,
and contract sha. Export as markdown, HTML, or an SVG verdict
badge for the PR description.
zigttp proofs list | show | diff | export
Three binaries. Proof loop in the terminal. Expert in the loop.
init → dev → test → expert →
deploy
zigttp verify against the embedded Ed25519
key
curl -fsSL
https://raw.githubusercontent.com/srdjan/zigttp/main/install.sh
| sh
Pre-built binaries for macOS and Linux (x86_64, aarch64) -
v0.1.0-beta
Zero-overhead composition. Native speed.
guard(auth) |> guard(log) |> handler |>
guard(cors)
Desugared to a single flat function with sequential if-checks at compile time. Zero runtime overhead.
zigttp:auth
JWT + webhooks
zigttp:crypto
SHA/HMAC/B64
zigttp:validate
JSON Schema
zigttp:decode
Parse + validate
zigttp:cache
KV store + TTL
zigttp:sql
SQLite
zigttp:io
Parallel I/O
zigttp:durable
Crash recovery
zigttp:compose
Guards + pipe
zigttp:router
Route matching
zigttp:env
Environment
zigttp:http
Cookies + CORS
zigttp:url
URL parsing
zigttp:id
UUID/ULID/nano
zigttp:log
Structured logs
zigttp:text
Escape + slug
zigttp:time
ISO/HTTP dates
zigttp:ratelimit
Token bucket
zigttp:service
Service calls
zigttp:scope
Resource scopes
20 modules implemented in Zig - zero interpretation overhead.
zigttp vs the general-purpose runtimes
zigttp trades generality for verification, security, and deployment automation.
zigttp
Write handlers. Prove them. Ship them.
Opinionated subset
Parse-time rejection of footguns
Compile-time verification
Every path, every type, every boolean
Automatic sandboxing
Least-privilege derived from analysis
Structured I/O
Linear code, parallel execution
Durable execution
Crash recovery via write-ahead oplog
Deterministic replay
Record I/O boundaries, replay anywhere
Proven evolution
Diff contracts, classify changes into four verdicts
Guarantees by default
All enforced by default; Spec<...> narrows
to a chosen few
Proof ledger
A persistent verdict timeline for every deploy
Witness corpus
Counterexamples persist; regressions are caught, not
rediscovered
Native performance
~7ms cold start - 4.8MB - ~13MB baseline