News for hackers. Stuff that matters.
Re:Amazon Ion – A richly-typed, self-describing, hierarchica... by FpUser on Friday November 19, 2021 @10:37PM (#29285347)
I had exactly the same implementation except that type / version belonged to the whole message and would map to appropriate binary buffer in memory. No real de/serialization was needed.

I still use it in my UDP game servers, with added packet id if message exceeds max datagram length and has to be split

Re:Amazon Ion – A richly-typed, self-describing, hierarchica... by ericbarrett on Friday November 19, 2021 @10:50PM (#29285392)
The one concern I'd have with this format is a length field getting corrupted in transit and causing an out-of-bounds memory access. The network protocols' checksums won't save you 100% of the time, especially if there's bad hardware in the loop. If every field is fixed length this is less of a concern, of course; you might get bad data but you won't get e.g. a string with length 64M.
Re:Amazon Ion – A richly-typed, self-describing, hierarchica... by hliyan on Friday November 19, 2021 @10:59PM (#29285445)
In our system, if the message didn't unpack properly, the application would send a retransmit request with that message's sequence number. But in practice, this scenario never occurred because TCP already did this for us.
Re:Amazon Ion – A richly-typed, self-describing, hierarchica... by FpUser on Friday November 19, 2021 @10:59PM (#29285446)
I do not remember it ever happening but being semi-paranoid I had length in 2 places - beginning and the end of the message.