September 29, 2026 Read on lucumr.pocoo.org
5.8

Deser: Rethinking Rust Serialization

RustDeveloper ToolsSoftware EngineeringOpen Source

Armin Ronacher argues that Serde's most frustrating limitations—broken flattening with integer keys, in-band signalling for arbitrary precision numbers, and non-composable adapters—are not bugs but structural consequences of three core design decisions that cannot be fixed without breaking the ecosystem. He presents Deser, an experiment he started in 2022 and recently revived, which inverts Serde's architecture: instead of types pulling values from a deserializer via visitors, formats push events into heap-allocated sinks, with a driver managing all nested state. This push-based design enables no stack overflows, suspendable/async-friendly deserialization, lossless buffering through enum tagging, and composable type-level adapters. Deser now covers all major self-describing formats including XML, which Serde has never properly supported. The honest conclusion is that replacing Serde in the ecosystem is nearly impossible due to the orphan rule, but Deser is a complete alternative for projects willing to accept the tradeoffs.

Serde's limitations are load-bearing architectural decisions, not fixable bugs, and the only path forward is inverting its control flow entirely—accepting that a better design cannot coexist with the existing ecosystem.
  • 7

    None of these are bugs that are easy to fix in Serde. They fall out of its design, and that design is protected by Serde's stability guarantees.

  • 5

    If you want to 'fix' Serde, you need to make some other compromises.

  • 8

    The biggest cost is that it's just not Serde.

  • 6

    The orphan rule entrenches Serde incredibly well in the ecosystem.

  • 6

    Serde's stability guarantees mean that a lot of them cannot be fixed without breaking every format and every hand written implementation.

  • 4

    Notice how John is gone.

  • 5

    Deser is Serde but the other way around.

  • 5

    Every level of nesting uses stack space. Formats protect against this with a recursion limit, but the moment you go through a code path that doesn't have one, deeply nested data can take down your process.

technical, opinionated, pragmatic