Post

Deser: Rethinking Rust Serialization

Deser is an alternative Rust serialization design that trades Serde’s broad format model for lossless buffering, composable adapters, extensible values, and deserialization state kept on the heap rather than recursive calls on the stack.

The author walks through concrete Serde edge cases involving internally tagged enums, flattened integer-key maps, and adapters that do not compose. Deser aims to preserve format metadata and error locations, support pausable streaming, and avoid stack growth on deeply nested input. Those benefits come with real trade-offs: formats that aren’t self-describing, such as protobuf, are deliberately excluded; JSON performance is mixed and averages about 10% slower to read in the author’s measurements; and the implementation uses unsafe internally. The author presents it as an option for workloads where those trade-offs fit, not a likely ecosystem-wide Serde replacement.

The linked Lobsters thread showed no readable comments in the direct view, so source reactions were unavailable.