Re:Rust 2018 survey results
by qaq on Wednesday November 28, 2018 @06:54AM
(#18550827)
Thats a fairly big restriction though and a sign of type system that is not flexible enough.
[ Parent
| on HN ]
Re:Rust 2018 survey results
by Matthias247 on Wednesday November 28, 2018 @03:28PM
(#18555331)
Maybe. However your representation isn't without drawbacks either: All fields are typed by strings, and are thereby not strongly typed. And each additional level (in an array or object) requires mandatory boxing and allocations. The codegen variants on pure structs don't have this drawbacks.
I would say your representation is favorable when someone wants to work with arbitrary JSON in a flexible fashion. However if schemas and code generators are available, I would prefer to use those.