Deser: Rethinking Rust Serialization

A software developer discusses the technical limitations and edge cases of the popular Rust serialization library, Serde. The author highlights specific issues with enum tagging, arbitrary precision numbers, and data flattening that complicate complex data handling.
Why it matters
Serde is a foundational library in the Rust ecosystem; understanding its limitations is critical for developers building high-performance or complex data-processing applications.
Serde is an amazing serialization library for Rust and it has been a huge reason why I felt productive with it for years. However already while at Sentry I got quite frustrated with some of the limitations with it but actually replacing Serde is tricky because of the might that it has in the ecosystem. Also because it’s quite hard to actually do better without also making some potentially painful compromises.
Here are three examples of Serde corner cases that show poor interactions of Serde features or unexpected limitations:
An internally tagged enum, with serde_json ‘s arbitrary_precision feature turned on:
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in