The JavaScript runtime that proves your code
Compile-time verification - Automatic sandboxing - Deterministic replay
You write a handler. You ship it. You pray.
Virtual modules are the only I/O boundary.
The handler's IR tree IS the control flow graph - no back-edges, no exceptions. The compiler can prove what every handler does, what it accesses, what it returns.
Unsupported features fail at parse time with a suggested alternative - not at runtime.
$ zigttp build handler.ts -Dverify
→ all code paths verified ✓
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"
}
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()
Record every I/O boundary with --trace. Replay against new versions. Handlers = pure functions of (Request, VirtualModuleResponses).
--trace / --replayDiff contracts + replay traces between handler versions. Result: equivalent, additive, or breaking - with a proof certificate.
-Dprove=contract:tracesGenerate platform-specific deployment configs from proven contracts. Env vars → params, routes → API events, egress → tags.
-Ddeploy=awsguard(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:validate
JSON Schema
zigttp:cache
KV store
zigttp:crypto
SHA/HMAC/B64
zigttp:sql
SQLite
zigttp:io
Parallel I/O
zigttp:compose
Guards + pipe
zigttp:durable
Crash recovery
Implemented in Zig - zero interpretation overhead.
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
Effect classification
Handler properties proven at build time
OpenAPI generation
Response schemas from type inference
Native performance
3ms init - 1.2MB - 4MB baseline