Skip to main content

One post tagged with "mutation"

View All Tags

Rust Made Object Mutation Hard—So We Designed It Properly

· 9 min read
Philip Z
Architect

Object mutation feels simple in many languages. Load an object, call a setter, and save it. If the object has children, mutate those too. Somewhere underneath, an ORM compares snapshots, observes setters, or walks an identity map and turns the differences into database commands.

Then we implemented the same programming model in Rust.

Rust did not let us casually hide shared mutable state behind an object graph. Ownership and borrowing forced us to answer questions that our other runtimes had allowed us to postpone.