November 7, 2025
Type wars and Terraform tears
We chose OCaml to write Stategraph
OCaml promises zero bugs; commenters say 'TypeScript can do it'
TLDR: Stategraph chose OCaml to keep Terraform state error-free using strict types and locked queries. The community split fast: some say TypeScript can do the same, others argue language choice is personal—and a few think the post is just hype. It matters because these tools guard real, fragile cloud setups.
Stategraph says it picked OCaml to keep your cloud setup from ever breaking, period. The tool tracks Terraform state (think: the map of your app’s servers and settings) and claims OCaml’s strict types, locked database queries, and immutability mean no sneaky bugs slip into production. Big promise, big reactions.
Cue the crowd: one engineer asked, basically, “who is this for?”, saying their org already prevents chaos with workspace locks and careful releases. Another chorus shouted, “you can do all this in TypeScript”, the popular web language, suggesting OCaml isn’t uniquely magical. A seasoned commenter dialed down the hype: the real reason teams pick a language is often “we like it”, and that’s okay—just say it.
The drama escalated with jokes and eye-rolls. Some called OCaml the “compiler hall monitor” that won’t let you make typos; others teased the post as a “go viral and get clicks” moment. Fans loved the promise of zero state corruption; skeptics pointed out that locks, testing, and boring discipline already work. Whether you’re team OCaml or team “a strong type system anywhere,” the thread turned into a spicy language war with memes, side-eyes, and a lot of “show me the receipts.”
Key Points
- •Stategraph manages Terraform state as a dependency graph in PostgreSQL with resource-level locking to prevent concurrent corruption.
- •OCaml was chosen for its strong type system, enabling compile-time checks that catch field, type, and null-handling errors.
- •Immutability by default and database-level locking are used to avoid race conditions and unsafe concurrent writes.
- •Type-safe SQL enforces explicit parameter and return types, preventing schema drift by breaking builds on mismatches.
- •Terraform state is ingested and output as JSON, with transformations designed to avoid data loss or corruption.