From Scripts to Contracts
What Rust's type system taught me about infrastructure composition — RustLab 2026, Bologna
From Scripts to Contracts
RustLab 2026 · Bologna · room RustLab Deep Space · 3 November 2026, 12:15 · 45 minutes with Q&A.
▤ Read the slides — real text, not screenshots ▶ Interactive version (Slidev) ⇩ PDF
I spent years automating infrastructure with scripts that worked until they didn’t. A missing dependency, a half-applied deploy, a config that looked right but wasn’t — the alert always came at 3am. The tools I used typed individual resources but not the relationships between them. The dependency graph lived in my head.
So I rebuilt it around one idea: infrastructure deserves the same type discipline as application code. Not just resource validation — typed contracts over the entire composition. Every deployment facet — networking, secrets, orchestration, monitoring, a control center, a cryptographic vault — is an independent module that composes through contracts, not glue scripts. The deploy is a typed DAG with parallel resolution, automatic rollback, and state recovery. Event-driven coordination keeps services in sync. If it doesn’t typecheck, it doesn’t touch a server.
What I didn’t expect was how this changed the way I think about infrastructure. Adding a cloud provider or a new concern means satisfying a contract, not modifying a core. Workspaces aggregate multiple deployment facets into a single typed pipeline that validates end to end.
The arc
- The problem — infrastructure that fails silently.
- The idea — type the composition, not just the resources.
- The implementation — what Rust’s ownership model and trait system contribute, and where the analogy breaks.
- The honest limits — external state and cloud APIs don’t respect your type system.
With a live overview of a real cluster running on this stack. For intermediate Rust developers with some exposure to infrastructure or deployment; no prior knowledge of a specific IaC tool is needed.
Cover photo: Piazza Maggiore, Bologna — Max Nayman, Unsplash.
· reads