Re:A distributed, tag-based pub-sub service for modern web a...
by viraptor on Monday November 16, 2015 @11:09PM
(#10579119)
Actually this proposal is quite bad compared to simple "<4 bytes size><size bytes contents>". If you use netstrings recursively like djb recommends, you will end up copying / reallocing the strings many times. Since your top-level length depends on the lower level length, you cannot send it without actually calculating the whole contents. Asn1 DER has the same issue because of the weird size encoding.
RIFF is a bit better https://en.wikipedia.org/wiki/Resource_Interchange_File_Form... with strict length,tag,contents format.