What's a good #format to serialize simple structured #data in an efficient way?

I'm thinking about some binary #XML encoding. Also, #ASN.1 because it natively uses integers, not just strings. Is the packed representation (PER) widely supported?

The data will be a bunch of interleaved time series streams, so variable field lengths could be a big win.

Is there a format for stuff like that?

#Matroska's EBML? Only I'd have to hack the schema in.

#mkv #serialization #formats

@dcz Protobufs? Flat buffers? Cap'n Proto? Apache Thrift?
capnp - Rust

Cap’n Proto Runtime Library

@nickzoic Definitely not flatbuffers:

> There is an experimental support only in C++ for a vector of unions

@nickzoic Protobuf is also out:

> A oneof cannot be repeated.

https://protobuf.dev/programming-guides/proto3/#oneof-features

Language Guide (proto 3)

Covers how to use the proto3 revision of the Protocol Buffers language in your project.

@dcz cap'n is the less stupid one in the list, the API is not great in Rust but it forces you to know exactly what you're doing, and it's as close to zero cost as possible