Post

HN
Hacker News

Learnings from 100K lines of Rust with AI (2025)

In the past few months, Iโ€™ve been stress-testing how far AI coding agents can take us when building real, production-grade distributed systems.

The result: a Rust-based multi-Paxos consensus engine that not only implements all the features of Azureโ€™s Replicated State Library (RSL) [ 1 ] โ€” which underpins most major Azure services โ€” but also modernizes it for todayโ€™s hardware.

The entire project took me ~3 months, with 100K lines of Rust code written in ~4 weeks and performance optimization from 23K operations/sec to 300K ops/sec achieved in ~3 weeks.

Besides unprecedented productivity, I discovered several techniques that were instrumental. This post shares my most valuable learnings on: ensuring correctness with code contracts, applying lightweight spec-driven development, and pursuing aggressive performance optimization โ€” plus my wish list for the future of AI-assisted coding.

Azureโ€™s RSL implements the multi-Paxos consensus protocol and forms the backbone of replication in many Azure services. However, RSL was written more than a decade ago. While robust, it hasnโ€™t evolved to match modern hardware and workloads.

There are three key gaps motivated this project: